aboutsummaryrefslogtreecommitdiff
path: root/test/parallel/test-path.js
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2017-07-06 17:14:16 +0200
committerMichaël Zasso <targos@protonmail.com>2017-08-30 14:44:55 +0200
commitb98e8d995efb426bbdee56ce503017bdcbbc6332 (patch)
tree44292dffa5e70a1484207677f47292a4b94b577e /test/parallel/test-path.js
parent244ada3c71588f02c10c0fcc526863660d460c96 (diff)
downloadandroid-node-v8-b98e8d995efb426bbdee56ce503017bdcbbc6332.tar.gz
android-node-v8-b98e8d995efb426bbdee56ce503017bdcbbc6332.tar.bz2
android-node-v8-b98e8d995efb426bbdee56ce503017bdcbbc6332.zip
path: fix normalize on directories with two dots
PR-URL: https://github.com/nodejs/node/pull/14107 Fixes: https://github.com/nodejs/node/issues/14105 Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'test/parallel/test-path.js')
-rw-r--r--test/parallel/test-path.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js
index bbab4829a4..5125aef01f 100644
--- a/test/parallel/test-path.js
+++ b/test/parallel/test-path.js
@@ -432,6 +432,11 @@ assert.strictEqual(path.win32.normalize('C:..\\..\\abc\\..\\def'),
'C:..\\..\\def');
assert.strictEqual(path.win32.normalize('C:\\.'), 'C:\\');
assert.strictEqual(path.win32.normalize('file:stream'), 'file:stream');
+assert.strictEqual(path.win32.normalize('bar\\foo..\\..\\'), 'bar\\');
+assert.strictEqual(path.win32.normalize('bar\\foo..\\..'), 'bar');
+assert.strictEqual(path.win32.normalize('bar\\foo..\\..\\baz'), 'bar\\baz');
+assert.strictEqual(path.win32.normalize('bar\\foo..\\'), 'bar\\foo..\\');
+assert.strictEqual(path.win32.normalize('bar\\foo..'), 'bar\\foo..');
assert.strictEqual(path.posix.normalize('./fixtures///b/../b/c.js'),
'fixtures/b/c.js');
@@ -441,6 +446,11 @@ assert.strictEqual(path.posix.normalize('a//b//./c'), 'a/b/c');
assert.strictEqual(path.posix.normalize('a//b//.'), 'a/b');
assert.strictEqual(path.posix.normalize('/a/b/c/../../../x/y/z'), '/x/y/z');
assert.strictEqual(path.posix.normalize('///..//./foo/.//bar'), '/foo/bar');
+assert.strictEqual(path.posix.normalize('bar/foo../../'), 'bar/');
+assert.strictEqual(path.posix.normalize('bar/foo../..'), 'bar');
+assert.strictEqual(path.posix.normalize('bar/foo../../baz'), 'bar/baz');
+assert.strictEqual(path.posix.normalize('bar/foo../'), 'bar/foo../');
+assert.strictEqual(path.posix.normalize('bar/foo..'), 'bar/foo..');
// path.resolve tests