Browse Source

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 <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
process-exit-stdio-flushing
Michael Cornacchia 9 years ago
committed by James M Snell
parent
commit
c0bac95147
  1. 8
      test/addons/repl-domain-abort/test.js

8
test/addons/repl-domain-abort/test.js

@ -1,10 +1,14 @@
'use strict'; 'use strict';
require('../../common'); var common = require('../../common');
var assert = require('assert'); var assert = require('assert');
var repl = require('repl'); var repl = require('repl');
var stream = require('stream'); var stream = require('stream');
var path = require('path');
var buildType = process.config.target_defaults.default_configuration; 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; var cb_ran = false;
process.on('exit', function() { process.on('exit', function() {

Loading…
Cancel
Save