diff options
author | Owen Smith <owen@omsmith.ca> | 2016-02-26 15:53:20 -0500 |
---|---|---|
committer | Roman Reiss <me@silverwind.io> | 2016-02-27 17:30:44 +0100 |
commit | e326950498ced98e31dc7d84a81f3be74f8b6f7e (patch) | |
tree | e098536d34ef3248336316d8ebd525b8891fc296 /test/parallel/test-path.js | |
parent | b33879d9e287aab0129e8d67ceb4852b9d1be48e (diff) | |
download | android-node-v8-e326950498ced98e31dc7d84a81f3be74f8b6f7e.tar.gz android-node-v8-e326950498ced98e31dc7d84a81f3be74f8b6f7e.tar.bz2 android-node-v8-e326950498ced98e31dc7d84a81f3be74f8b6f7e.zip |
path: fix win32 relative() for UNC paths
win32 normalize() will output a trailing '\' for some UNC paths. trim
them before processing
Change by @mscdex
Add basic UNC path tests to win32 relative()
PR-URL: https://github.com/nodejs/node/pull/5456
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'test/parallel/test-path.js')
-rw-r--r-- | test/parallel/test-path.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js index 92b0358d8e..3ec2e905f5 100644 --- a/test/parallel/test-path.js +++ b/test/parallel/test-path.js @@ -471,7 +471,12 @@ const relativeTests = [ ['c:/aaaaa/', 'c:/aaaa/cccc', '..\\aaaa\\cccc'], ['C:\\foo\\bar\\baz\\quux', 'C:\\', '..\\..\\..\\..'], ['C:\\foo\\test', 'C:\\foo\\test\\bar\\package.json', 'bar\\package.json'], - ['C:\\foo\\bar\\baz-quux', 'C:\\foo\\bar\\baz', '..\\baz'] + ['C:\\foo\\bar\\baz-quux', 'C:\\foo\\bar\\baz', '..\\baz'], + ['C:\\foo\\bar\\baz', 'C:\\foo\\bar\\baz-quux', '..\\baz-quux'], + ['\\\\foo\\bar', '\\\\foo\\bar\\baz', 'baz'], + ['\\\\foo\\bar\\baz', '\\\\foo\\bar', '..'], + ['\\\\foo\\bar\\baz-quux', '\\\\foo\\bar\\baz', '..\\baz'], + ['\\\\foo\\bar\\baz', '\\\\foo\\bar\\baz-quux', '..\\baz-quux'] ] ], [ path.posix.relative, |