Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
squash: use Buffer.from
  • Loading branch information
not-an-aardvark committed Oct 22, 2016
commit 275b17b7bb71f5228d07273de2a111190cce70a2
4 changes: 2 additions & 2 deletions test/parallel/test-buffer-alloc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1063,12 +1063,12 @@ assert.throws(function() {
// issue GH-9226
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be better to provide a URL instead (or at least in addition).

{
const buf = Buffer.alloc(4, 'YQ==', 'base64');
const expectedBuf = new Buffer([97, 97, 97, 97]);
const expectedBuf = Buffer.from([97, 97, 97, 97]);
assert(buf.equals(expectedBuf));
}
{
const buf = Buffer.alloc(4, 'ab', 'ascii');
const expectedBuf = new Buffer([97, 98, 97, 98]);
const expectedBuf = Buffer.from([97, 98, 97, 98]);
assert(buf.equals(expectedBuf));
}

Expand Down