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 16, 2017
1 parent 49e30e8 commit 5f7469a
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 5f7469a

Please sign in to comment.