summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-06-24 16:40:33 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-06-24 16:40:33 +0200
commitf9421dd847e3a80d3890a1e41833e5bbfcfbcc86 (patch)
treeceed138b8910f3afc7faf99dd9728102e8193f34
parentpath-util: fix an issue when the path argument of prefix_roota() is not absolute (diff)
downloadsystemd-f9421dd847e3a80d3890a1e41833e5bbfcfbcc86.tar.xz
systemd-f9421dd847e3a80d3890a1e41833e5bbfcfbcc86.zip
test: add more testcases for prefix_roota()
-rw-r--r--src/test/test-path-util.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c
index 7ef30ffc00..3e91c87eea 100644
--- a/src/test/test-path-util.c
+++ b/src/test/test-path-util.c
@@ -403,6 +403,9 @@ static void test_prefix_root(void) {
test_prefix_root_one("///", "/foo", "/foo");
test_prefix_root_one("/", "////foo", "/foo");
test_prefix_root_one(NULL, "////foo", "/foo");
+ test_prefix_root_one("/", "foo", "/foo");
+ test_prefix_root_one("", "foo", "foo");
+ test_prefix_root_one(NULL, "foo", "foo");
test_prefix_root_one("/foo", "/bar", "/foo/bar");
test_prefix_root_one("/foo", "bar", "/foo/bar");