From cedd813f524449cf8691fb273201bb114104d060 Mon Sep 17 00:00:00 2001 From: James Kylstra Date: Fri, 8 Jun 2018 08:13:09 -0500 Subject: [PATCH] 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. --- test/parallel/test-intl.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/parallel/test-intl.js b/test/parallel/test-intl.js index a1aea88aaddd92..df683333f46437 100644 --- a/test/parallel/test-intl.js +++ b/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(coll.compare('blackbird', 'black-bird'), 0, - 'ignore punctuation failed'); - assert.strictEqual(coll.compare('blackbird', 'red-bird'), -1, - 'compare less failed'); - assert.strictEqual(coll.compare('bluebird', 'blackbird'), 1, - 'compare greater failed'); - assert.strictEqual(coll.compare('Bluebird', 'bluebird'), 0, - 'ignore case failed'); - assert.strictEqual(coll.compare('\ufb03', 'ffi'), 0, - 'ffi ligature (contraction) failed'); + // ignore punctuation failed + assert.strictEqual(coll.compare('blackbird', 'black-bird'), 0); + // compare less failed + assert.strictEqual(coll.compare('blackbird', 'red-bird'), -1); + // compare greater failed + assert.strictEqual(coll.compare('bluebird', 'blackbird'), 1); + // ignore case failed + assert.strictEqual(coll.compare('Bluebird', 'bluebird'), 0); + // ffi ligature (contraction) failed + assert.strictEqual(coll.compare('\ufb03', 'ffi'), 0); }