summaryrefslogtreecommitdiff
path: root/test/parallel/test-path.js
diff options
context:
space:
mode:
authorMike Kaufman <mkaufman@microsoft.com>2016-04-05 14:30:38 -0700
committerRich Trott <rtrott@gmail.com>2016-04-08 16:43:07 -0700
commit1384de29f77daf85743d5194cb54769cb7600530 (patch)
tree4b466eec0699792cce1d18acdc209f97282d5377 /test/parallel/test-path.js
parentc5afd98b4868bb2f258a8125dd8447e3ccfba1c5 (diff)
downloadandroid-node-v8-1384de29f77daf85743d5194cb54769cb7600530.tar.gz
android-node-v8-1384de29f77daf85743d5194cb54769cb7600530.tar.bz2
android-node-v8-1384de29f77daf85743d5194cb54769cb7600530.zip
path: fixing a test that breaks on some machines.
A win32-only test was verifying that path.win32._makeLong('C:') would return the current working directory. This would only work if current working directory was also on the C: device. Fix is to grab the device letter for current working directory, and pass that to _makeLong(). PR-URL: https://github.com/nodejs/node/pull/6067 Reviewed-By: Trott - Rich Trott <rtrott@gmail.com> Reviewed-By: Joao Reis <reis@janeasystems.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Diffstat (limited to 'test/parallel/test-path.js')
-rw-r--r--test/parallel/test-path.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js
index 267b0ac14d..b6859f79bc 100644
--- a/test/parallel/test-path.js
+++ b/test/parallel/test-path.js
@@ -561,7 +561,8 @@ if (common.isWindows) {
'\\\\?\\' + process.cwd().toLowerCase() + '\\foo\\bar');
assert.equal(path.win32._makeLong('foo/bar').toLowerCase(),
'\\\\?\\' + process.cwd().toLowerCase() + '\\foo\\bar');
- assert.equal(path.win32._makeLong('C:').toLowerCase(),
+ const currentDeviceLetter = path.parse(process.cwd()).root.substring(0, 2);
+ assert.equal(path.win32._makeLong(currentDeviceLetter).toLowerCase(),
'\\\\?\\' + process.cwd().toLowerCase());
assert.equal(path.win32._makeLong('C').toLowerCase(),
'\\\\?\\' + process.cwd().toLowerCase() + '\\c');