From a05f973f82d2be8527aad4c371d40d3c7e4c564e Mon Sep 17 00:00:00 2001 From: Scott Blomquist Date: Mon, 18 Mar 2013 10:48:13 -0700 Subject: test: Misc Windows unit test fixes Fixes #5071, #5073. * Normalize capitalization of drive letter * Fix `exit()` typo in failure path * Ignore symlink tests (Windows) if not elevated The `test_relative_input_cwd()` test was failing on Windows when `skipSymlinks` was `true`. So we won't run it if `skipSymlinks` is `true`. When it failed, the unhandled error caused Node to die before having a chance to clean up, which resulted in two files missing in subsequent unit tests: * `test/fixtures/nested-index/one/hello.js` * `test/fixtures/nested-index/one/index.js` We should probably find a way to isolate this test from the other test (`simple/test-module-loading`) that was failing when this test poluted the disk state. --- lib/path.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/path.js') diff --git a/lib/path.js b/lib/path.js index da0f8bee68..db0cdea2dd 100644 --- a/lib/path.js +++ b/lib/path.js @@ -176,6 +176,11 @@ if (isWindows) { tail = result[3], trailingSlash = /[\\\/]$/.test(tail); + // If device is a drive letter, we'll normalize to lower case. + if (device && device.charAt(1) === ':') { + device = device[0].toLowerCase() + device.substr(1); + } + // Normalize the tail path tail = normalizeArray(tail.split(/[\\\/]+/).filter(function(p) { return !!p; -- cgit v1.2.3