Skip to content

Commit

Permalink
test: fix assertions args order in test/parallel/test-fs-chmod.js
Browse files Browse the repository at this point in the history
PR-URL: #23507
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
milsosa authored and MylesBorins committed Oct 30, 2018
1 parent 6f590be commit 119fc3a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/parallel/test-fs-chmod.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ fs.chmod(file1, mode_async.toString(8), common.mustCall((err) => {
if (common.isWindows) {
assert.ok((fs.statSync(file1).mode & 0o777) & mode_async);
} else {
assert.strictEqual(mode_async, fs.statSync(file1).mode & 0o777);
assert.strictEqual(fs.statSync(file1).mode & 0o777, mode_async);
}

fs.chmodSync(file1, mode_sync);
if (common.isWindows) {
assert.ok((fs.statSync(file1).mode & 0o777) & mode_sync);
} else {
assert.strictEqual(mode_sync, fs.statSync(file1).mode & 0o777);
assert.strictEqual(fs.statSync(file1).mode & 0o777, mode_sync);
}
}));

Expand All @@ -106,7 +106,7 @@ fs.open(file2, 'w', common.mustCall((err, fd) => {
if (common.isWindows) {
assert.ok((fs.fstatSync(fd).mode & 0o777) & mode_async);
} else {
assert.strictEqual(mode_async, fs.fstatSync(fd).mode & 0o777);
assert.strictEqual(fs.fstatSync(fd).mode & 0o777, mode_async);
}

common.expectsError(
Expand All @@ -123,7 +123,7 @@ fs.open(file2, 'w', common.mustCall((err, fd) => {
if (common.isWindows) {
assert.ok((fs.fstatSync(fd).mode & 0o777) & mode_sync);
} else {
assert.strictEqual(mode_sync, fs.fstatSync(fd).mode & 0o777);
assert.strictEqual(fs.fstatSync(fd).mode & 0o777, mode_sync);
}

fs.close(fd, assert.ifError);
Expand All @@ -139,10 +139,10 @@ if (fs.lchmod) {
fs.lchmod(link, mode_async, common.mustCall((err) => {
assert.ifError(err);

assert.strictEqual(mode_async, fs.lstatSync(link).mode & 0o777);
assert.strictEqual(fs.lstatSync(link).mode & 0o777, mode_async);

fs.lchmodSync(link, mode_sync);
assert.strictEqual(mode_sync, fs.lstatSync(link).mode & 0o777);
assert.strictEqual(fs.lstatSync(link).mode & 0o777, mode_sync);

}));
}
Expand Down Expand Up @@ -170,5 +170,5 @@ if (fs.lchmod) {
});

process.on('exit', function() {
assert.strictEqual(0, openCount);
assert.strictEqual(openCount, 0);
});

0 comments on commit 119fc3a

Please sign in to comment.