Skip to content

Commit c4518ab

Browse files
Mike Kaufmanjasnell
Mike Kaufman
authored andcommittedApr 26, 2016
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: #6067 Reviewed-By: Trott - Rich Trott <[email protected]> Reviewed-By: Joao Reis <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Johan Bergström <[email protected]>
1 parent 16f011e commit c4518ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎test/parallel/test-path.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,8 @@ if (common.isWindows) {
561561
'\\\\?\\' + process.cwd().toLowerCase() + '\\foo\\bar');
562562
assert.equal(path.win32._makeLong('foo/bar').toLowerCase(),
563563
'\\\\?\\' + process.cwd().toLowerCase() + '\\foo\\bar');
564-
assert.equal(path.win32._makeLong('C:').toLowerCase(),
564+
const currentDeviceLetter = path.parse(process.cwd()).root.substring(0, 2);
565+
assert.equal(path.win32._makeLong(currentDeviceLetter).toLowerCase(),
565566
'\\\\?\\' + process.cwd().toLowerCase());
566567
assert.equal(path.win32._makeLong('C').toLowerCase(),
567568
'\\\\?\\' + process.cwd().toLowerCase() + '\\c');

0 commit comments

Comments
 (0)
Please sign in to comment.