From fc89d176560db5b0c2e5ceabbfac0d12f30b51ea Mon Sep 17 00:00:00 2001 From: Mike Kaufman Date: Tue, 5 Apr 2016 14:30:38 -0700 Subject: [PATCH] path: fixing a test that breaks on some machines. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Joao Reis Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell Reviewed-By: Johan Bergström --- test/parallel/test-path.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js index f8fb94348d4d75..9f0a2415c49d92 100644 --- a/test/parallel/test-path.js +++ b/test/parallel/test-path.js @@ -562,7 +562,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');