Skip to content
Browse files

test: remove string literals from assert.strictEqual() calls

In test/parallel/test-intl.js, five calls to assert.strictEqual() use a
third, string-literal parameter, which specifies a message to display
when the assertion fails. The problem is that if the assertion fails,
the error message will show the string literal but not the values that
caused the assertion to fail.

This commit removes the third parameter from the five calls and makes
them comments above the assertions instead. The default error message
produced by assert.strictEqual() shows the values that caused the
assertion to fail, which should be somewhat more helpful.

PR-URL: #21211
Reviewed-By: James M Snell <>
Reviewed-By: Rich Trott <>
Reviewed-By: Luigi Pinca <>
Reviewed-By: Colin Ihrig <>
Reviewed-By: Trivikram Kamat <>
  • Loading branch information
kylstraj authored and trivikr committed Jun 11, 2018
1 parent ceaf7b3 commit 928805bb22bb46ebf41c7c1890a6d7bda65ba7db
Showing with 10 additions and 10 deletions.
  1. +10 −10 test/parallel/test-intl.js
@@ -105,14 +105,14 @@ if (!common.hasIntl) {
const collOpts = { sensitivity: 'base', ignorePunctuation: true };
const coll = new Intl.Collator(['en'], collOpts);

assert.strictEqual('blackbird', 'black-bird'), 0,
'ignore punctuation failed');
assert.strictEqual('blackbird', 'red-bird'), -1,
'compare less failed');
assert.strictEqual('bluebird', 'blackbird'), 1,
'compare greater failed');
assert.strictEqual('Bluebird', 'bluebird'), 0,
'ignore case failed');
assert.strictEqual('\ufb03', 'ffi'), 0,
'ffi ligature (contraction) failed');
// ignore punctuation
assert.strictEqual('blackbird', 'black-bird'), 0);
// compare less
assert.strictEqual('blackbird', 'red-bird'), -1);
// compare greater
assert.strictEqual('bluebird', 'blackbird'), 1);
// ignore case
assert.strictEqual('Bluebird', 'bluebird'), 0);
// ffi ligature (contraction)
assert.strictEqual('\ufb03', 'ffi'), 0);

0 comments on commit 928805b

Please sign in to comment.