From 9a33347363ab2864433c2c375f8f54fc3cdb8d5c Mon Sep 17 00:00:00 2001 From: Mike Kaufman Date: Tue, 5 Apr 2016 14:30:38 -0700 Subject: [PATCH 1/3] 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(). --- .gitignore | 1 + test/parallel/test-path.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 734d92d4d719af..4abf176dbc0d41 100644 --- a/.gitignore +++ b/.gitignore @@ -41,6 +41,7 @@ _UpgradeReport_Files/ ipch/ *.sdf *.opensdf +node.VC.opendb /config.mk /config.gypi diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js index 267b0ac14de3d0..7bd8c1a3afa78f 100644 --- a/test/parallel/test-path.js +++ b/test/parallel/test-path.js @@ -561,8 +561,9 @@ 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(), - '\\\\?\\' + process.cwd().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'); } From 146b83ea66762cee02299197f784568c97e74acc Mon Sep 17 00:00:00 2001 From: Mike Kaufman Date: Tue, 5 Apr 2016 16:20:30 -0700 Subject: [PATCH 2/3] reverting changes to include node.VC.opendb in .gitignore file --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4abf176dbc0d41..734d92d4d719af 100644 --- a/.gitignore +++ b/.gitignore @@ -41,7 +41,6 @@ _UpgradeReport_Files/ ipch/ *.sdf *.opensdf -node.VC.opendb /config.mk /config.gypi From 2508595447ef1a15975ffbdabb3649f878d1e2b6 Mon Sep 17 00:00:00 2001 From: Mike Kaufman Date: Wed, 6 Apr 2016 17:20:53 -0700 Subject: [PATCH 3/3] fixing indentation per PR comments --- test/parallel/test-path.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js index 7bd8c1a3afa78f..b6859f79bc8403 100644 --- a/test/parallel/test-path.js +++ b/test/parallel/test-path.js @@ -563,7 +563,7 @@ if (common.isWindows) { '\\\\?\\' + process.cwd().toLowerCase() + '\\foo\\bar'); const currentDeviceLetter = path.parse(process.cwd()).root.substring(0, 2); assert.equal(path.win32._makeLong(currentDeviceLetter).toLowerCase(), - '\\\\?\\' + process.cwd().toLowerCase()); + '\\\\?\\' + process.cwd().toLowerCase()); assert.equal(path.win32._makeLong('C').toLowerCase(), '\\\\?\\' + process.cwd().toLowerCase() + '\\c'); }