From: Yu Watanabe Date: Thu, 18 Feb 2021 15:49:37 +0000 (+0900) Subject: test: add more tests for path_startswith() X-Git-Tag: v248-rc1~19^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1dff135bf916b4a9d5e1172e69d4dde53651035c;p=thirdparty%2Fsystemd.git test: add more tests for path_startswith() --- diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c index 58b185494df..59308473c1b 100644 --- a/src/test/test-path-util.c +++ b/src/test/test-path-util.c @@ -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) {