Skip to content

Commit 04f3f6d

Browse files
bzozMylesBorins
authored andcommitted
test: escape script filename on Windows
Escape backslashes in script filename on Windows in a CLI test. PR-URL: #16124 Fixes: #16057 and #16023 Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 501acdf commit 04f3f6d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/parallel/test-cli-eval.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ child.exec(`${nodejs} --use-strict -p process.execArgv`,
118118

119119
// Regression test for https://github.com/nodejs/node/issues/3574.
120120
{
121-
const emptyFile = fixtures.path('empty.js');
121+
let emptyFile = fixtures.path('empty.js');
122+
if (common.isWindows) {
123+
emptyFile = emptyFile.replace(/\\/g, '\\\\');
124+
}
122125

123126
child.exec(`${nodejs} -e 'require("child_process").fork("${emptyFile}")'`,
124127
common.mustCall((err, stdout, stderr) => {

0 commit comments

Comments
 (0)