]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: add more tests for path_startswith()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 18 Feb 2021 15:49:37 +0000 (00:49 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 20 Feb 2021 19:40:23 +0000 (04:40 +0900)
src/test/test-path-util.c

index 58b185494df3f456ef1389f97b93ea38a64e425a..59308473c1be8eed40d6caef803b2d24c248c098 100644 (file)
@@ -481,6 +481,9 @@ static void test_path_startswith(void) {
         assert_se(!path_startswith("/foo/bar/barfoo/", ""));
         assert_se(!path_startswith("/foo/bar/barfoo/", "/bar/foo"));
         assert_se(!path_startswith("/foo/bar/barfoo/", "/f/b/b/"));
+        assert_se(!path_startswith("/foo/bar/barfoo/", "/foo/bar/barfo"));
+        assert_se(!path_startswith("/foo/bar/barfoo/", "/foo/bar/bar"));
+        assert_se(!path_startswith("/foo/bar/barfoo/", "/fo"));
 }
 
 static void test_prefix_root_one(const char *r, const char *p, const char *expected) {