Skip to content

Commit 37235a3

Browse files
earobinsontargos
authored andcommitted
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: #15884 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent dc48e9c commit 37235a3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/parallel/test-string-decoder.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ function test(encoding, input, expected, singleSequence) {
154154
output += decoder.end();
155155
if (output !== expected) {
156156
const message =
157-
'Expected "' + unicodeEscape(expected) + '", ' +
158-
'but got "' + unicodeEscape(output) + '"\n' +
159-
'input: ' + input.toString('hex').match(hexNumberRE) + '\n' +
160-
'Write sequence: ' + JSON.stringify(sequence) + '\n' +
161-
'Full Decoder State: ' + inspect(decoder);
157+
`Expected "${unicodeEscape(expected)}", ` +
158+
`but got "${unicodeEscape(output)}"\n` +
159+
`input: ${input.toString('hex').match(hexNumberRE)}\n` +
160+
`Write sequence: ${JSON.stringify(sequence)}\n` +
161+
`Full Decoder State: ${inspect(decoder)}`;
162162
assert.fail(output, expected, message);
163163
}
164164
});

0 commit comments

Comments
 (0)