diff options
author | Evan Lucas <evanlucas@me.com> | 2016-03-07 19:31:14 +0300 |
---|---|---|
committer | Evan Lucas <evanlucas@me.com> | 2016-03-07 23:48:49 +0300 |
commit | 3d3b45ae958f5bfc8cfdbdb30bcfd512a18740af (patch) | |
tree | 5c7ff9af45484cc458f51566e943296d727491ec /test | |
parent | 1d9a2b28bb1388c6086a14d63c142c466d60057e (diff) |
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')
-rw-r--r-- | test/parallel/test-path.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js index fce54a52fb3..eb49360defd 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 |