From 8072a2b85cf889fc0fe93a8727822d6f3b086ba8 Mon Sep 17 00:00:00 2001 From: Takahiro Nakamura Date: Sat, 24 Nov 2018 16:57:19 +0900 Subject: [PATCH] test: fix arguments order in `assert.strictEqual` PR-URL: https://github.com/nodejs/node/pull/24621 Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Joyee Cheung Reviewed-By: Gireesh Punathil Reviewed-By: Masashi Hirano --- test/parallel/test-fs-write-buffer.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/parallel/test-fs-write-buffer.js b/test/parallel/test-fs-write-buffer.js index 0ff9fd69a82a3a..362571f2479c84 100644 --- a/test/parallel/test-fs-write-buffer.js +++ b/test/parallel/test-fs-write-buffer.js @@ -38,11 +38,11 @@ tmpdir.refresh(); const cb = common.mustCall((err, written) => { assert.ifError(err); - assert.strictEqual(expected.length, written); + assert.strictEqual(written, expected.length); fs.closeSync(fd); const found = fs.readFileSync(filename, 'utf8'); - assert.strictEqual(expected.toString(), found); + assert.strictEqual(found, expected.toString()); }); fs.write(fd, expected, 0, expected.length, null, cb); @@ -78,7 +78,7 @@ tmpdir.refresh(); const cb = common.mustCall(function(err, written) { assert.ifError(err); - assert.strictEqual(expected.length, written); + assert.strictEqual(written, expected.length); fs.closeSync(fd); const found = fs.readFileSync(filename, 'utf8'); @@ -98,7 +98,7 @@ tmpdir.refresh(); const cb = common.mustCall(function(err, written) { assert.ifError(err); - assert.strictEqual(expected.length, written); + assert.strictEqual(written, expected.length); fs.closeSync(fd); const found = fs.readFileSync(filename, 'utf8'); @@ -118,11 +118,11 @@ tmpdir.refresh(); const cb = common.mustCall((err, written) => { assert.ifError(err); - assert.strictEqual(expected.length, written); + assert.strictEqual(written, expected.length); fs.closeSync(fd); const found = fs.readFileSync(filename, 'utf8'); - assert.strictEqual(expected.toString(), found); + assert.strictEqual(found, expected.toString()); }); fs.write(fd, expected, undefined, undefined, cb); @@ -138,11 +138,11 @@ tmpdir.refresh(); const cb = common.mustCall((err, written) => { assert.ifError(err); - assert.strictEqual(expected.length, written); + assert.strictEqual(written, expected.length); fs.closeSync(fd); const found = fs.readFileSync(filename, 'utf8'); - assert.strictEqual(expected.toString(), found); + assert.strictEqual(found, expected.toString()); }); fs.write(fd, Uint8Array.from(expected), cb);