From b365168fd054b7528d3a54b0ed01c9823454aafc Mon Sep 17 00:00:00 2001 From: Jean-Francois Arseneau Date: Fri, 12 Oct 2018 09:53:32 -0700 Subject: [PATCH 1/2] test: put expected assert value in correct place The order of arguments in test-fs-readdir-ucs2 was the opposite of what is recommended in the documentation, which is that the first value should be the value being tested, and the second value is the expected value. This fixes the test to make it conform to the documentation. --- test/parallel/test-fs-readdir-ucs2.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-fs-readdir-ucs2.js b/test/parallel/test-fs-readdir-ucs2.js index b17dc8d7292664..29710aacbf70b1 100644 --- a/test/parallel/test-fs-readdir-ucs2.js +++ b/test/parallel/test-fs-readdir-ucs2.js @@ -25,8 +25,8 @@ try { fs.readdir(tmpdir.path, 'ucs2', common.mustCall((err, list) => { assert.ifError(err); - assert.strictEqual(1, list.length); + assert.strictEqual(list.length, 1); const fn = list[0]; - assert.deepStrictEqual(filebuff, Buffer.from(fn, 'ucs2')); - assert.strictEqual(fn, filename); + assert.deepStrictEqual(Buffer.from(fn, 'ucs2'), filebuff); + assert.strictEqual(filename, fn); })); From bc7b852d37016bb579244d56c7617df1008ebe53 Mon Sep 17 00:00:00 2001 From: Jean-Francois Arseneau Date: Fri, 12 Oct 2018 10:25:02 -0700 Subject: [PATCH 2/2] test: fix wrongly ordered arguments --- test/parallel/test-fs-readdir-ucs2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-fs-readdir-ucs2.js b/test/parallel/test-fs-readdir-ucs2.js index 29710aacbf70b1..e5b85665932a7c 100644 --- a/test/parallel/test-fs-readdir-ucs2.js +++ b/test/parallel/test-fs-readdir-ucs2.js @@ -28,5 +28,5 @@ fs.readdir(tmpdir.path, 'ucs2', common.mustCall((err, list) => { assert.strictEqual(list.length, 1); const fn = list[0]; assert.deepStrictEqual(Buffer.from(fn, 'ucs2'), filebuff); - assert.strictEqual(filename, fn); + assert.strictEqual(fn, filename); }));