diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-09-06 17:57:18 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-09-06 17:57:18 +0100 |
| commit | 97144ee9f557ef4886456972d36583b6b62685d2 (patch) | |
| tree | ce4265dc24f418db6d1738bd5043067d56ba7856 /tests | |
| parent | ced42637087b386df99cfd017262afad03b809ce (diff) | |
Support relative URIs
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/docx/files.tests.js | 14 |
1 files changed, 14 insertions, 0 deletions
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"); + }); }); |
