Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fc89d17

Browse filesBrowse files
Mike KaufmanMyles Borins
authored andcommitted
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 <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>
1 parent 2254f1a commit fc89d17
Copy full SHA for fc89d17

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-path.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-path.js
+2-1Lines changed: 2 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.