summaryrefslogtreecommitdiff
path: root/test/parallel/test-path.js
diff options
context:
space:
mode:
authorEvan Lucas <evanlucas@me.com>2016-03-07 10:31:14 -0600
committerEvan Lucas <evanlucas@me.com>2016-03-07 14:48:49 -0600
commit3d3b45ae958f5bfc8cfdbdb30bcfd512a18740af (patch)
tree5c7ff9af45484cc458f51566e943296d727491ec /test/parallel/test-path.js
parent1d9a2b28bb1388c6086a14d63c142c466d60057e (diff)
downloadandroid-node-v8-3d3b45ae958f5bfc8cfdbdb30bcfd512a18740af.tar.gz
android-node-v8-3d3b45ae958f5bfc8cfdbdb30bcfd512a18740af.tar.bz2
android-node-v8-3d3b45ae958f5bfc8cfdbdb30bcfd512a18740af.zip
path: fix normalize for absolutes
Fixes a regression introduced by b212be08f62a48656c5befd8be0a82d691ea66e4. path.normalize(''/a/b/c/../../../x/y/z'') should return '/x/y/z'. Fixes: https://github.com/nodejs/node/issues/5585 PR-URL: https://github.com/nodejs/node/pull/5589 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
Diffstat (limited to 'test/parallel/test-path.js')
-rw-r--r--test/parallel/test-path.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js
index fce54a52fb..eb49360def 100644
--- a/test/parallel/test-path.js
+++ b/test/parallel/test-path.js
@@ -377,6 +377,7 @@ assert.equal(path.win32.normalize('a//b//./c'), 'a\\b\\c');
assert.equal(path.win32.normalize('a//b//.'), 'a\\b');
assert.equal(path.win32.normalize('//server/share/dir/file.ext'),
'\\\\server\\share\\dir\\file.ext');
+assert.equal(path.win32.normalize('/a/b/c/../../../x/y/z'), '\\x\\y\\z');
assert.equal(path.posix.normalize('./fixtures///b/../b/c.js'),
'fixtures/b/c.js');
@@ -384,6 +385,8 @@ assert.equal(path.posix.normalize('/foo/../../../bar'), '/bar');
assert.equal(path.posix.normalize('a//b//../b'), 'a/b');
assert.equal(path.posix.normalize('a//b//./c'), 'a/b/c');
assert.equal(path.posix.normalize('a//b//.'), 'a/b');
+assert.equal(path.posix.normalize('/a/b/c/../../../x/y/z'), '/x/y/z');
+assert.equal(path.posix.normalize('///..//./foo/.//bar'), '/foo/bar');
// path.resolve tests