Skip to content

Commit e3ac7b1

Browse files
bzoztargos
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 e8f59f7 commit e3ac7b1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/parallel/test-cli-eval.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ child.exec(`${nodejs} --use-strict -p process.execArgv`,
139139

140140
// Regression test for https://github.com/nodejs/node/issues/3574.
141141
{
142-
const emptyFile = fixtures.path('empty.js');
142+
let emptyFile = fixtures.path('empty.js');
143+
if (common.isWindows) {
144+
emptyFile = emptyFile.replace(/\\/g, '\\\\');
145+
}
143146

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

0 commit comments

Comments
 (0)