projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9dcde10
)
test: add more tests for path_startswith()
author
Yu Watanabe
<watanabe.yu+github@gmail.com>
Thu, 18 Feb 2021 15:49:37 +0000
(
00:49
+0900)
committer
Yu Watanabe
<watanabe.yu+github@gmail.com>
Sat, 20 Feb 2021 19:40:23 +0000
(
04:40
+0900)
src/test/test-path-util.c
patch
|
blob
|
history
diff --git
a/src/test/test-path-util.c
b/src/test/test-path-util.c
index 58b185494df3f456ef1389f97b93ea38a64e425a..59308473c1be8eed40d6caef803b2d24c248c098 100644
(file)
--- 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) {