From 4d3307579bbcb3e48bb2cf36fcc889eb8df71df6 Mon Sep 17 00:00:00 2001 From: Edward Andrew Robinson Date: Fri, 6 Oct 2017 09:55:46 -0700 Subject: [PATCH 1/2] test: use template literals in test-string-decoder `test/parallel/test-string-decoder.js` used to use string concatenation this was migrated to use template literals. When concatenation involved a newline we kept string concatenation, or to keep below 80 charters per line. --- test/parallel/test-string-decoder.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/parallel/test-string-decoder.js b/test/parallel/test-string-decoder.js index a13741180689b6..fafb4f700fe2ed 100644 --- a/test/parallel/test-string-decoder.js +++ b/test/parallel/test-string-decoder.js @@ -164,11 +164,11 @@ function test(encoding, input, expected, singleSequence) { output += decoder.end(); if (output !== expected) { const message = - 'Expected "' + unicodeEscape(expected) + '", ' + - 'but got "' + unicodeEscape(output) + '"\n' + - 'input: ' + input.toString('hex').match(hexNumberRE) + '\n' + - 'Write sequence: ' + JSON.stringify(sequence) + '\n' + - 'Full Decoder State: ' + inspect(decoder); + `Expected "${unicodeEscape(expected)}", ` + + `but got "${unicodeEscape(output)}"\n ` + + `input: ${input.toString('hex').match(hexNumberRE)}\n` + + `Write sequence: ${JSON.stringify(sequence)}\n` + + `Full Decoder State: ${inspect(decoder)}`; assert.fail(output, expected, message); } }); From 4cd32ba67716cb7b8c8fd19284d47f172e352c33 Mon Sep 17 00:00:00 2001 From: Edward Andrew Robinson Date: Tue, 10 Oct 2017 08:13:35 -0400 Subject: [PATCH 2/2] Resolved comments https://github.com/nodejs/node/pull/15884#pullrequestreview-68196014 --- test/parallel/test-string-decoder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-string-decoder.js b/test/parallel/test-string-decoder.js index fafb4f700fe2ed..f1b11477008a7f 100644 --- a/test/parallel/test-string-decoder.js +++ b/test/parallel/test-string-decoder.js @@ -165,7 +165,7 @@ function test(encoding, input, expected, singleSequence) { if (output !== expected) { const message = `Expected "${unicodeEscape(expected)}", ` + - `but got "${unicodeEscape(output)}"\n ` + + `but got "${unicodeEscape(output)}"\n` + `input: ${input.toString('hex').match(hexNumberRE)}\n` + `Write sequence: ${JSON.stringify(sequence)}\n` + `Full Decoder State: ${inspect(decoder)}`;