diff options
Diffstat (limited to 'posix/testfnm.c')
-rw-r--r-- | posix/testfnm.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/posix/testfnm.c b/posix/testfnm.c index b43f9531fb..5a6c7e12ea 100644 --- a/posix/testfnm.c +++ b/posix/testfnm.c @@ -15,7 +15,38 @@ struct { { "a/b", "[a-z]/[a-z]", 0, 0 }, { "a/b", "*", FNM_FILE_NAME, FNM_NOMATCH }, { "a/b", "*[/]b", FNM_FILE_NAME, FNM_NOMATCH }, - { "a/b", "*[b]", FNM_FILE_NAME, FNM_NOMATCH } + { "a/b", "*[b]", FNM_FILE_NAME, FNM_NOMATCH }, + { "a/b", "[*]/b", 0, FNM_NOMATCH }, + { "*/b", "[*]/b", 0, 0 }, + { "a/b", "[?]/b", 0, FNM_NOMATCH }, + { "?/b", "[?]/b", 0, 0 }, + { "a/b", "[[a]/b", 0, 0 }, + { "[/b", "[[a]/b", 0, 0 }, + { "a/b", "\\*/b", 0, FNM_NOMATCH }, + { "*/b", "\\*/b", 0, 0 }, + { "a/b", "\\?/b", 0, FNM_NOMATCH }, + { "?/b", "\\?/b", 0, 0 }, + { "[/b", "[/b", 0, FNM_NOMATCH }, + { "[/b", "\\[/b", 0, 0 }, + { "aa/b", "??/b", 0, 0 }, + { "aa/b", "???b", 0, 0 }, + { "aa/b", "???b", FNM_PATHNAME, FNM_NOMATCH }, + { ".a/b", "?a/b", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH }, + { "a/.b", "a/?b", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH }, + { ".a/b", "*a/b", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH }, + { "a/.b", "a/*b", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH }, + { ".a/b", "[.]a/b", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH }, + { "a/.b", "a/[.]b", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH }, + { "a/b", "*/?", FNM_PATHNAME|FNM_PERIOD, 0 }, + { "a/b", "?/*", FNM_PATHNAME|FNM_PERIOD, 0 }, + { ".a/b", ".*/?", FNM_PATHNAME|FNM_PERIOD, 0 }, + { "a/.b", "*/.?", FNM_PATHNAME|FNM_PERIOD, 0 }, + { "a/.b", "*/*", FNM_PATHNAME|FNM_PERIOD, FNM_NOMATCH }, + { "a/.b", "*?*/*", FNM_PERIOD, 0 }, + { "a./b", "*[.]/b", FNM_PATHNAME|FNM_PERIOD, 0 }, + { "a/b", "*[[:alpha:]]/*[[:alnum:]]", FNM_PATHNAME, 0 }, + { "a/b", "*[![:digit:]]*/[![:d-d]", FNM_PATHNAME, 0 }, + { "a/[", "*[![:digit:]]*/[![:d-d]", FNM_PATHNAME, FNM_NOMATCH }, }; int |