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 2024-07-23 21:07:34 +09:00 committed by GitHub
parent 42fd6401c2
commit 1eac9a3d41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -52,7 +52,14 @@ function testCwd(options, expectPidType, expectCode = 0, expectData) {
}); });
child.on('close', common.mustCall(function() { 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; return child;