Skip to content

Commit

Permalink
test: fix path to module for repl test on Windows
Browse files Browse the repository at this point in the history
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: #3608
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
mcornac authored and Myles Borins committed Nov 16, 2015
1 parent bb20abb commit c10f17f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/addons/repl-domain-abort/test.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down

0 comments on commit c10f17f

Please sign in to comment.