Skip to content

Commit

Permalink
test: update test-buffer-alloc to use tpl literals
Browse files Browse the repository at this point in the history
Updated a single usage of string concatenation to use template literals.
There are other usages of string concatenation in this file, but they
are used to make test code more readable.
  • Loading branch information
bwhitty committed Oct 6, 2017
1 parent 0c49038 commit 34e7486
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/parallel/test-buffer-alloc.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,12 @@ assert.strictEqual('TWFu', (Buffer.from('Man')).toString('base64'));
assert.strictEqual(quote, b.toString('ascii', 0, quote.length));

// check that the base64 decoder ignores whitespace
const expectedWhite = expected.slice(0, 60) + ' \n' +
expected.slice(60, 120) + ' \n' +
expected.slice(120, 180) + ' \n' +
expected.slice(180, 240) + ' \n' +
expected.slice(240, 300) + '\n' +
expected.slice(300, 360) + '\n';
const expectedWhite = `${expected.slice(0, 60)}
${expected.slice(60, 120)}
${expected.slice(120, 180)}
${expected.slice(180, 240)}
${expected.slice(240, 300)}
${expected.slice(300, 360)}`;
b = Buffer.allocUnsafe(1024);
bytesWritten = b.write(expectedWhite, 0, 'base64');
assert.strictEqual(quote.length, bytesWritten);
Expand Down

0 comments on commit 34e7486

Please sign in to comment.