From 0e8eb66a78dc446b084a64ae61c2b7363ba459b0 Mon Sep 17 00:00:00 2001 From: Michael Cornacchia Date: Fri, 30 Oct 2015 12:08:49 -0400 Subject: [PATCH] test: fix path to module for repl test on Windows Use path join to construct the path instead of concatenating strings. Replace backslash with double backslash so that they are escaped correctly in the string passed to REPL. PR-URL: https://github.com/nodejs/node/pull/3608 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- test/addons/repl-domain-abort/test.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/addons/repl-domain-abort/test.js b/test/addons/repl-domain-abort/test.js index 1268b61f362eed..bbd0c737eeba49 100644 --- a/test/addons/repl-domain-abort/test.js +++ b/test/addons/repl-domain-abort/test.js @@ -1,10 +1,14 @@ 'use strict'; -require('../../common'); +var common = require('../../common'); var assert = require('assert'); var repl = require('repl'); var stream = require('stream'); +var path = require('path'); var buildType = process.config.target_defaults.default_configuration; -var buildPath = __dirname + '/build/' + buildType + '/binding'; +var buildPath = path.join(__dirname, 'build', buildType, 'binding'); +// On Windows, escape backslashes in the path before passing it to REPL. +if (common.isWindows) + buildPath = buildPath.replace(/\\/g, '/'); var cb_ran = false; process.on('exit', function() {