From a6ef21c6b33407f456423f543735a6697fd84b65 Mon Sep 17 00:00:00 2001 From: EarlyRiser42 Date: Mon, 22 Jul 2024 22:49:07 +0900 Subject: [PATCH 1/2] test: compare paths on Windows without considering case --- test/parallel/test-child-process-cwd.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-child-process-cwd.js b/test/parallel/test-child-process-cwd.js index b527b7f9ea8012..3251e9225d137c 100644 --- a/test/parallel/test-child-process-cwd.js +++ b/test/parallel/test-child-process-cwd.js @@ -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 (process.platform === 'win32') { + assert.strictEqual(data.trim().toLowerCase(), expectData.toLowerCase()); + } else { + assert.strictEqual(data.trim(), expectData); + } + } })); return child; From 9362a7069fa7410b070a04ae76925935d81f5489 Mon Sep 17 00:00:00 2001 From: EarlyRiser42 Date: Tue, 23 Jul 2024 10:27:13 +0900 Subject: [PATCH 2/2] test: replace process.platform check with common.isWindows --- test/parallel/test-child-process-cwd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-child-process-cwd.js b/test/parallel/test-child-process-cwd.js index 3251e9225d137c..e876361b167ffb 100644 --- a/test/parallel/test-child-process-cwd.js +++ b/test/parallel/test-child-process-cwd.js @@ -54,7 +54,7 @@ function testCwd(options, expectPidType, expectCode = 0, expectData) { child.on('close', common.mustCall(function() { if (expectData) { // In Windows, compare without considering case - if (process.platform === 'win32') { + if (common.isWindows) { assert.strictEqual(data.trim().toLowerCase(), expectData.toLowerCase()); } else { assert.strictEqual(data.trim(), expectData);