From 8f87a8a16b635e4f8a6c0b6bb7ae1c77a5440995 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Tue, 10 Oct 2017 14:57:55 +0200 Subject: [PATCH] win, test: escape script filename on Windows Escape backslashes in script filename on Windows in a CLI test. Fixes: https://github.com/nodejs/node/issues/16057 Fixes: https://github.com/nodejs/node/issues/16023 --- 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 0853d7a29b8ca0..201d5a6a49739b 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) => {