From e2174e4e3cfd6e74846510f42b7fa7086e49c2f9 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sun, 22 Mar 2020 10:42:39 +0100 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/32408#issuecomment-602170887 PR-URL: https://github.com/nodejs/node/pull/32420 Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Jiawen Geng Reviewed-By: Luigi Pinca --- test/parallel/test-fs-utimes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-fs-utimes.js b/test/parallel/test-fs-utimes.js index fa2ddcbeeda2b7..c5ed73733c5c40 100644 --- a/test/parallel/test-fs-utimes.js +++ b/test/parallel/test-fs-utimes.js @@ -150,7 +150,7 @@ if (!process.arch.includes('arm') && const Y2K38_mtime = 2 ** 31; fs.utimesSync(path, Y2K38_mtime, Y2K38_mtime); const Y2K38_stats = fs.statSync(path); - assert.strictEqual(Y2K38_mtime, Y2K38_stats.mtime.getTime() / 1000); + assert.strictEqual(Y2K38_stats.mtime.getTime() / 1000, Y2K38_mtime); } if (common.isWindows) { @@ -158,7 +158,7 @@ if (common.isWindows) { const truncate_mtime = 1713037251360; fs.utimesSync(path, truncate_mtime / 1000, truncate_mtime / 1000); const truncate_stats = fs.statSync(path); - assert.strictEqual(truncate_mtime, truncate_stats.mtime.getTime()); + assert.strictEqual(truncate_stats.mtime.getTime(), truncate_mtime); // test Y2K38 for windows // This value if treaded as a `signed long` gets converted to -2135622133469. @@ -168,7 +168,7 @@ if (common.isWindows) { const overflow_mtime = 2159345162531; fs.utimesSync(path, overflow_mtime / 1000, overflow_mtime / 1000); const overflow_stats = fs.statSync(path); - assert.strictEqual(overflow_mtime, overflow_stats.mtime.getTime()); + assert.strictEqual(overflow_stats.mtime.getTime(), overflow_mtime); } const expectTypeError = {