Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: fix arguments order in assert.strictEqual
  • Loading branch information
na9amura committed Nov 24, 2018
commit e3ccd2657700b4ce50c2b5f7374f4c0f5af1ed60
16 changes: 8 additions & 8 deletions test/parallel/test-fs-write-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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');
Expand All @@ -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');
Expand All @@ -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);
Expand All @@ -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);
Expand Down