X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Fmatch-test.c;h=9be05efbe45674cb9a0bacdf8139f8407c2b26a6;hb=0b384eedceb290242dbc4759ca16cbb1370c26de;hp=63717385b68aef34bb19ec6b0931c6f9c5b3d325;hpb=42ff24f2a525d5965e1841b2ebe3ee0f4b918ac6;p=debian%2Famanda diff --git a/common-src/match-test.c b/common-src/match-test.c index 6371738..9be05ef 100644 --- a/common-src/match-test.c +++ b/common-src/match-test.c @@ -26,7 +26,7 @@ * Tests */ -static int +static gboolean test_validate_regexp(void) { gboolean ok = TRUE; @@ -59,7 +59,7 @@ test_validate_regexp(void) return ok; } -static int +static gboolean test_match(void) { gboolean ok = TRUE; @@ -184,7 +184,7 @@ test_match(void) return ok; } -static int +static gboolean test_validate_glob(void) { gboolean ok = TRUE; @@ -224,7 +224,7 @@ test_validate_glob(void) return ok; } -static int +static gboolean test_glob_to_regex(void) { gboolean ok = TRUE; @@ -253,7 +253,7 @@ test_glob_to_regex(void) return ok; } -static int +static gboolean test_match_glob(void) { gboolean ok = TRUE; @@ -325,7 +325,7 @@ test_match_glob(void) return ok; } -static int +static gboolean test_match_tar(void) { gboolean ok = TRUE; @@ -442,7 +442,7 @@ test_match_tar(void) return ok; } -static int +static gboolean test_make_exact_host_expression(void) { gboolean ok = TRUE; @@ -493,7 +493,7 @@ test_make_exact_host_expression(void) return ok; } -static int +static gboolean test_match_host(void) { gboolean ok = TRUE; @@ -605,7 +605,7 @@ test_match_host(void) return ok; } -static int +static gboolean test_make_exact_disk_expression(void) { gboolean ok = TRUE; @@ -649,7 +649,7 @@ test_make_exact_disk_expression(void) return ok; } -static int +static gboolean test_match_disk(void) { gboolean ok = TRUE; @@ -706,8 +706,10 @@ test_match_disk(void) { "\\\\\\\\windows\\\\share", "\\\\windows\\share", TRUE }, /* other expressions */ - { "^local", "/local", TRUE }, - { "^local", "/local/vore", TRUE }, + { "^local", "/local", FALSE }, + { "^/local", "/local", TRUE }, + { "^local", "/local/vore", FALSE }, + { "^/local", "/local/vore", TRUE }, { "^local", "/usr/local", FALSE }, { "local/bin", "/local/bin", TRUE }, @@ -740,7 +742,41 @@ test_match_disk(void) { "/usr\\/bin", "/usr/bin", TRUE }, { "^/usr\\/bin$", "/usr/bin", TRUE }, { "\\/usr\\/bin", "/usr/bin", FALSE }, - { "^\\/usr\\/bin$", "/usr/bin", FALSE }, + { "^\\/usr\\/bin$", "/usr/bin", TRUE }, + { "/usr\\/bin\\/", "/usr/bin/", TRUE }, + { "^/usr\\/bin\\/$", "/usr/bin/", TRUE }, + { "\\/usr\\/bin\\/", "/usr/bin/", FALSE }, + { "^\\/usr\\/bin\\/$", "/usr/bin/", TRUE }, + + { "oracle", "oracle", TRUE }, + { "oracle", "/oracle", TRUE }, + { "oracle", "oracle/", TRUE }, + { "oracle", "/oracle/", TRUE }, + { "/oracle", "oracle", TRUE }, + { "/oracle", "/oracle", TRUE }, + { "/oracle", "oracle/", TRUE }, + { "/oracle", "/oracle/", TRUE }, + { "^oracle", "oracle", TRUE }, + { "^oracle", "/oracle", FALSE }, + { "^oracle", "oracle/", TRUE }, + { "^oracle", "/oracle/", FALSE }, + { "^/oracle", "oracle", FALSE }, + { "^/oracle", "/oracle", TRUE }, + { "^/oracle", "oracle/", FALSE }, + { "^/oracle", "/oracle/", TRUE }, + + { "oracle", "oracle", TRUE }, + { "oracle", "/oracle", TRUE }, + { "oracle", "oracle/", TRUE }, + { "oracle", "/oracle/", TRUE }, + { "oracle$", "oracle", TRUE }, + { "oracle$", "/oracle", TRUE }, + { "oracle$", "oracle/", FALSE }, + { "oracle$", "/oracle/", FALSE }, + { "oracle/$", "oracle", FALSE }, + { "oracle/$", "/oracle", FALSE }, + { "oracle/$", "oracle/", TRUE }, + { "oracle/$", "/oracle/", TRUE }, { NULL, NULL, FALSE }, }, *t; @@ -762,7 +798,7 @@ test_match_disk(void) return ok; } -static int +static gboolean test_match_datestamp(void) { gboolean ok = TRUE; @@ -846,7 +882,7 @@ test_match_datestamp(void) return ok; } -static int +static gboolean test_match_level(void) { gboolean ok = TRUE;