From 04f3f6dd6ae24b3934ad5128b3938d2997e49b7f Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Tue, 10 Oct 2017 14:57:55 +0200 Subject: [PATCH] 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 Reviewed-By: Stephen Belanger Reviewed-By: James M Snell --- test/parallel/test-cli-eval.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-cli-eval.js b/test/parallel/test-cli-eval.js index 71900cf5da6b1e..190a520e7d643f 100644 --- a/test/parallel/test-cli-eval.js +++ b/test/parallel/test-cli-eval.js @@ -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) => {