Skip to content

Commit e20b4f9

Browse files
bnoordhuisaddaleax
authored andcommitted
test: fix fs test-fs-utimes strictEqual arg order
`actual` is the first argument, `expected` the second, but the test flipped them around and was producing confusing assertion messages as a result. Refs: #32408 (comment) PR-URL: #32420 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 88b4e86 commit e20b4f9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/parallel/test-fs-utimes.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,15 @@ if (!process.arch.includes('arm') &&
150150
const Y2K38_mtime = 2 ** 31;
151151
fs.utimesSync(path, Y2K38_mtime, Y2K38_mtime);
152152
const Y2K38_stats = fs.statSync(path);
153-
assert.strictEqual(Y2K38_mtime, Y2K38_stats.mtime.getTime() / 1000);
153+
assert.strictEqual(Y2K38_stats.mtime.getTime() / 1000, Y2K38_mtime);
154154
}
155155

156156
if (common.isWindows) {
157157
// This value would get converted to (double)1713037251359.9998
158158
const truncate_mtime = 1713037251360;
159159
fs.utimesSync(path, truncate_mtime / 1000, truncate_mtime / 1000);
160160
const truncate_stats = fs.statSync(path);
161-
assert.strictEqual(truncate_mtime, truncate_stats.mtime.getTime());
161+
assert.strictEqual(truncate_stats.mtime.getTime(), truncate_mtime);
162162

163163
// test Y2K38 for windows
164164
// This value if treaded as a `signed long` gets converted to -2135622133469.
@@ -168,7 +168,7 @@ if (common.isWindows) {
168168
const overflow_mtime = 2159345162531;
169169
fs.utimesSync(path, overflow_mtime / 1000, overflow_mtime / 1000);
170170
const overflow_stats = fs.statSync(path);
171-
assert.strictEqual(overflow_mtime, overflow_stats.mtime.getTime());
171+
assert.strictEqual(overflow_stats.mtime.getTime(), overflow_mtime);
172172
}
173173

174174
const expectTypeError = {

0 commit comments

Comments
 (0)