From af014c1a5efce54a8154d8758657852954685e0c Mon Sep 17 00:00:00 2001 From: Igor Zinkovsky Date: Fri, 7 Oct 2011 17:08:48 -0700 Subject: [PATCH] fix for simple/test-executable-path.js on windows --- test/simple/test-executable-path.js | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/test/simple/test-executable-path.js b/test/simple/test-executable-path.js index 1e7224a4a8..c33a800748 100644 --- a/test/simple/test-executable-path.js +++ b/test/simple/test-executable-path.js @@ -22,21 +22,31 @@ var common = require('../common'); var assert = require('assert'); var path = require('path'); +var match = false; var isDebug = process.features.debug; -var debugPath = path.normalize(path.join(__dirname, '..', '..', - 'out', 'Debug', 'node')); -var defaultPath = path.normalize(path.join(__dirname, '..', '..', - 'out', 'Release', 'node')); +var debugPaths = [ path.normalize(path.join(__dirname, '..', '..', + 'out', 'Debug', 'node')), + path.normalize(path.join(__dirname, '..', '..', + 'Debug', 'node'))]; +var defaultPaths = [ path.normalize(path.join(__dirname, '..', '..', + 'out', 'Release', 'node')), + path.normalize(path.join(__dirname, '..', '..', + 'Release', 'node'))]; -console.error('debugPath: ' + debugPath); -console.error('defaultPath: ' + defaultPath); +console.error('debugPaths: ' + debugPaths); +console.error('defaultPaths: ' + defaultPaths); console.error('process.execPath: ' + process.execPath); if (isDebug) { - assert.ok(process.execPath.indexOf(debugPath) == 0); + debugPaths.forEach(function(path) { + match = match || process.execPath.indexOf(path) == 0; + }); } else { - assert.ok(process.execPath.indexOf(defaultPath) == 0); + defaultPaths.forEach(function(path) { + match = match || process.execPath.indexOf(path) == 0; + }); } +assert.ok(match);