0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-28 22:46:31 +01:00

test: escape script filename on Windows

Escape backslashes in script filename on Windows in a CLI test.

PR-URL: https://github.com/nodejs/node/pull/16124
Fixes: https://github.com/nodejs/node/issues/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>
This commit is contained in:
Bartosz Sosnowski 2017-10-10 14:57:55 +02:00 committed by James M Snell
parent 00fe76d2df
commit 07ec10d43b

View File

@ -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) => {