From 97144ee9f557ef4886456972d36583b6b62685d2 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 6 Sep 2015 17:57:18 +0100 Subject: Support relative URIs --- tests/docx/files.tests.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/docx/files.tests.js b/tests/docx/files.tests.js index 0221834..e37df6b 100644 --- a/tests/docx/files.tests.js +++ b/tests/docx/files.tests.js @@ -22,6 +22,16 @@ describe("Files", function() { }); }); }); + + test("can open files with relative URI", function() { + var filePath = path.resolve(testing.testPath("tiny-picture.png")); + var files = new Files(testing.testPath(".")); + return files.read("tiny-picture.png", "base64").then(function(contents) { + return readFile(filePath, "base64").then(function(expectedContents) { + assert.deepEqual(contents, expectedContents); + }); + }); + }); }); @@ -51,4 +61,8 @@ describe("uriToPath", function() { assert.equal(uriToPath("file:///c:/a", "win32"), "c:/a"); assert.equal(uriToPath("file:///C:/a", "win32"), "C:/a"); }); + + test("relative URI is unquoted", function() { + assert.equal(uriToPath("a%20b/c"), "a b/c"); + }); }); -- cgit v1.2.3