From 07ec10d43b91f85ba1b8af3331e8c38f3f071254 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 0853d7a29b8..201d5a6a497 100644 --- a/test/parallel/test-cli-eval.js +++ b/test/parallel/test-cli-eval.js @@ -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) => {