From a2b7bf93145ec0dbee96b95534c6badc5a82e2fd 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. --- 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() {