Skip to content

Commit 8cc52b0

Browse files
milsosajasnell
authored andcommitted
test: fix assertions args order in test/parallel/test-fs-chmod.js
PR-URL: #23507 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 5562932 commit 8cc52b0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/parallel/test-fs-chmod.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ fs.chmod(file1, mode_async.toString(8), common.mustCall((err) => {
8686
if (common.isWindows) {
8787
assert.ok((fs.statSync(file1).mode & 0o777) & mode_async);
8888
} else {
89-
assert.strictEqual(mode_async, fs.statSync(file1).mode & 0o777);
89+
assert.strictEqual(fs.statSync(file1).mode & 0o777, mode_async);
9090
}
9191

9292
fs.chmodSync(file1, mode_sync);
9393
if (common.isWindows) {
9494
assert.ok((fs.statSync(file1).mode & 0o777) & mode_sync);
9595
} else {
96-
assert.strictEqual(mode_sync, fs.statSync(file1).mode & 0o777);
96+
assert.strictEqual(fs.statSync(file1).mode & 0o777, mode_sync);
9797
}
9898
}));
9999

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

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

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

142-
assert.strictEqual(mode_async, fs.lstatSync(link).mode & 0o777);
142+
assert.strictEqual(fs.lstatSync(link).mode & 0o777, mode_async);
143143

144144
fs.lchmodSync(link, mode_sync);
145-
assert.strictEqual(mode_sync, fs.lstatSync(link).mode & 0o777);
145+
assert.strictEqual(fs.lstatSync(link).mode & 0o777, mode_sync);
146146

147147
}));
148148
}
@@ -170,5 +170,5 @@ if (fs.lchmod) {
170170
});
171171

172172
process.on('exit', function() {
173-
assert.strictEqual(0, openCount);
173+
assert.strictEqual(openCount, 0);
174174
});

0 commit comments

Comments
 (0)