Skip to content

Commit fc89d17

Browse files
Mike KaufmanMyles Borins
Mike Kaufman
authored and
Myles Borins
committed
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 2254f1a commit fc89d17

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
@@ -562,7 +562,8 @@ if (common.isWindows) {
562562
'\\\\?\\' + process.cwd().toLowerCase() + '\\foo\\bar');
563563
assert.equal(path.win32._makeLong('foo/bar').toLowerCase(),
564564
'\\\\?\\' + process.cwd().toLowerCase() + '\\foo\\bar');
565-
assert.equal(path.win32._makeLong('C:').toLowerCase(),
565+
const currentDeviceLetter = path.parse(process.cwd()).root.substring(0, 2);
566+
assert.equal(path.win32._makeLong(currentDeviceLetter).toLowerCase(),
566567
'\\\\?\\' + process.cwd().toLowerCase());
567568
assert.equal(path.win32._makeLong('C').toLowerCase(),
568569
'\\\\?\\' + process.cwd().toLowerCase() + '\\c');

0 commit comments

Comments
 (0)