Skip to content

Commit

Permalink
test: escape script filename on Windows
Browse files Browse the repository at this point in the history
Escape backslashes in script filename on Windows in a CLI test.

PR-URL: #16124
Fixes: #16057 and #16023
Reviewed-By: Daijiro Wachi <[email protected]>
Reviewed-By: Stephen Belanger <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
bzoz authored and MylesBorins committed Nov 21, 2017
1 parent d8f2d66 commit 548b74c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/parallel/test-cli-eval.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ child.exec(`${nodejs} --use-strict -p process.execArgv`,

// Regression test for https://github.com/nodejs/node/issues/3574.
{
const emptyFile = fixtures.path('empty.js');
let emptyFile = fixtures.path('empty.js');
if (common.isWindows) {
emptyFile = emptyFile.replace(/\\/g, '\\\\');
}

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

0 comments on commit 548b74c

Please sign in to comment.