Skip to content

Commit

Permalink
win, 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.

Fixes: nodejs#16057
Fixes: nodejs#16023
  • Loading branch information
bzoz committed Oct 10, 2017
1 parent 85a5a2c commit 8f87a8a
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 @@ -139,7 +139,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 8f87a8a

Please sign in to comment.