diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2018-11-05 21:12:05 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2018-11-05 22:35:47 +0000 |
| commit | 18f8137798ccf99c1f275fd1f6e2247e1e3e45ed (patch) | |
| tree | 31208ec2f2d8f7281a49c7a29139ceed4ea94df9 /testfiles | |
| parent | fix URI::from_dirname("/") (diff) | |
| download | inkscape-18f8137798ccf99c1f275fd1f6e2247e1e3e45ed.tar.gz inkscape-18f8137798ccf99c1f275fd1f6e2247e1e3e45ed.zip | |
Replacement for xmlBuildRelativeURI
- xmlBuildRelativeURI has a bug
- we add a special case: Don't cross filesystem root
Diffstat (limited to 'testfiles')
| -rw-r--r-- | testfiles/src/uri-test.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/testfiles/src/uri-test.cpp b/testfiles/src/uri-test.cpp index 6f0787af5..c10012d49 100644 --- a/testfiles/src/uri-test.cpp +++ b/testfiles/src/uri-test.cpp @@ -53,6 +53,15 @@ TEST(UriTest, Str) ASSERT_EQ(URI("foo/uri.svg", "http://web/a/b/c").str("http://web/a/"), "b/foo/uri.svg"); ASSERT_EQ(URI("foo/uri.svg", "http://web/a/b/c").str("http://other/a/"), "http://web/a/b/foo/uri.svg"); + ASSERT_EQ(URI("http://web/").str("http://web/"), ""); + ASSERT_EQ(URI("http://web/").str("http://web/url"), "./"); + + // special case: don't cross filesystem root + ASSERT_EQ(URI("file:///a").str("file:///"), "a"); + ASSERT_EQ(URI("file:///ax/b").str("file:///ay/"), "file:///ax/b"); // special case + ASSERT_EQ(URI("file:///C:/b").str("file:///D:/"), "file:///C:/b"); // special case + ASSERT_EQ(URI("file:///C:/a/b").str("file:///C:/b/"), "../a/b"); + const char *win_url_unc = "file://laptop/My%20Documents/FileSchemeURIs.doc"; const char *win_url_local = "file:///C:/Documents%20and%20Settings/davris/FileSchemeURIs.doc"; |
