]> git.ipfire.org Git - pakfire.git/commitdiff
tests: Add check for pakfire_path_match with stars in middle
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 17 Mar 2023 12:13:53 +0000 (12:13 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 17 Mar 2023 12:13:53 +0000 (12:13 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/libpakfire/util.c

index cea03ba3101803064c30bdd482b8161c5d3f9071..50276a2cbd95a208c0f0731db3810015e869453b 100644 (file)
@@ -94,6 +94,10 @@ static int test_path_match(const struct test* t) {
        // Partial paths shouldn't match
        ASSERT_FALSE(pakfire_path_match("/usr", "/usr/bin/bash"));
 
+       // Check for stars in the middle
+       ASSERT_TRUE(pakfire_path_match("/usr/lib64/*.so.*", "/usr/lib64/libblah.so.1"));
+       ASSERT_TRUE(pakfire_path_match("/usr/lib64/**/*.so", "/usr/lib64/blah/module.so"));
+
        return EXIT_SUCCESS;
 
 FAIL: