summaryrefslogtreecommitdiff
path: root/tests/path/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/path/core.c')
-rw-r--r--tests/path/core.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/path/core.c b/tests/path/core.c
index 0ab41ea50..dcc85fb78 100644
--- a/tests/path/core.c
+++ b/tests/path/core.c
@@ -352,3 +352,14 @@ void test_path_core__join_unrooted(void)
git_buf_free(&out);
}
+
+void test_path_core__join_unrooted_respects_funny_windows_roots(void)
+{
+ test_join_unrooted("💩:/foo/bar/foobar", 9, "bar/foobar", "💩:/foo");
+ test_join_unrooted("💩:/foo/bar/foobar", 13, "foobar", "💩:/foo/bar");
+ test_join_unrooted("💩:/foo", 5, "💩:/foo", "💩:/asdf");
+ test_join_unrooted("💩:/foo/bar", 5, "💩:/foo/bar", "💩:/asdf");
+ test_join_unrooted("💩:/foo/bar/foobar", 9, "💩:/foo/bar/foobar", "💩:/foo");
+ test_join_unrooted("💩:/foo/bar/foobar", 13, "💩:/foo/bar/foobar", "💩:/foo/bar");
+ test_join_unrooted("💩:/foo/bar/foobar", 9, "💩:/foo/bar/foobar", "💩:/foo/");
+}