test: compare paths on Windows without considering case

PR-URL: https://github.com/nodejs/node/pull/53993
Fixes: https://github.com/nodejs/node/issues/53989
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
Early Riser authored and Antoine du Hamel committed 2025-02-10 18:28:59 +01:00
1 parent 6e84d211a1
commit b08ce67d48
1 file changed
+8 -1
+8 -1
View File
@@ -52,7 +52,14 @@ function testCwd(options, expectPidType, expectCode = 0, expectData) {
});
child.on('close', common.mustCall(function() {
expectData && assert.strictEqual(data.trim(), expectData);
if (expectData) {
// In Windows, compare without considering case
if (common.isWindows) {
assert.strictEqual(data.trim().toLowerCase(), expectData.toLowerCase());
} else {
assert.strictEqual(data.trim(), expectData);
}
}
}));
return child;