Browse Source

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.

PR-URL: https://github.com/nodejs/node/pull/15884
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
v9.x-staging
Edward Andrew Robinson 7 years ago
committed by Rich Trott
parent
commit
3784b2d839
  1. 10
      test/parallel/test-string-decoder.js

10
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);
}
});

Loading…
Cancel
Save