aboutsummaryrefslogtreecommitdiff
path: root/test/zipfile.tests.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/zipfile.tests.js')
-rw-r--r--test/zipfile.tests.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/zipfile.tests.js b/test/zipfile.tests.js
index 3087dc8..5383c49 100644
--- a/test/zipfile.tests.js
+++ b/test/zipfile.tests.js
@@ -39,6 +39,7 @@ test("when path has no forward slashes then splitPath returns empty dirname", fu
test("joinPath joins arguments with forward slashes", function() {
assert.equal(zipfile.joinPath("a", "b"), "a/b");
assert.equal(zipfile.joinPath("a/b", "c"), "a/b/c");
+ assert.equal(zipfile.joinPath("a", "b/c"), "a/b/c");
assert.equal(zipfile.joinPath("/a/b", "c"), "/a/b/c");
});
@@ -48,3 +49,11 @@ test("empty parts are ignored when joining paths", function() {
assert.equal(zipfile.joinPath("", "b"), "b");
assert.equal(zipfile.joinPath("a", "", "b"), "a/b");
});
+
+
+test("when joining paths then absolute paths ignore earlier paths", function() {
+ assert.equal(zipfile.joinPath("a", "/b"), "/b");
+ assert.equal(zipfile.joinPath("a", "/b", "c"), "/b/c");
+ assert.equal(zipfile.joinPath("/a", "/b"), "/b");
+ assert.equal(zipfile.joinPath("/a"), "/a");
+});