summaryrefslogtreecommitdiffstats
path: root/testfiles/src/uri-test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'testfiles/src/uri-test.cpp')
-rw-r--r--testfiles/src/uri-test.cpp9
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";