diff options
Diffstat (limited to 'tests/unit/unit1307.c')
-rw-r--r-- | tests/unit/unit1307.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/unit/unit1307.c b/tests/unit/unit1307.c index 266eed39..0d2257bf 100644 --- a/tests/unit/unit1307.c +++ b/tests/unit/unit1307.c @@ -25,7 +25,6 @@ #define MATCH CURL_FNMATCH_MATCH #define NOMATCH CURL_FNMATCH_NOMATCH -#define RE_ERR CURL_FNMATCH_FAIL struct testcase { const char *pattern; @@ -36,8 +35,8 @@ struct testcase { static const struct testcase tests[] = { /* brackets syntax */ { "\\[", "[", MATCH }, - { "[", "[", RE_ERR }, - { "[]", "[]", RE_ERR }, + { "[", "[", MATCH }, + { "[]", "[]", MATCH }, { "[][]", "[", MATCH }, { "[][]", "]", MATCH }, { "[[]", "[", MATCH }, @@ -49,6 +48,8 @@ static const struct testcase tests[] = { { "[][[[]", "[", MATCH }, { "[[]", "]", NOMATCH }, + { "[a@]", "a", MATCH }, + { "[a-z]", "a", MATCH }, { "[a-z]", "A", NOMATCH }, { "?[a-z]", "?Z", NOMATCH }, @@ -77,6 +78,7 @@ static const struct testcase tests[] = { { "[][?*-]", "*", MATCH }, { "[][?*-]", "-", MATCH }, { "[]?*-]", "-", MATCH }, + { "[\xFF]", "\xFF", MATCH }, { "?/b/c", "a/b/c", MATCH }, { "^_{}~", "^_{}~", MATCH }, { "!#%+,-./01234567889", "!#%+,-./01234567889", MATCH }, @@ -97,8 +99,10 @@ static const struct testcase tests[] = { { "*[^a].t?t", "a.txt", NOMATCH }, { "*[^a].t?t", "ba.txt", NOMATCH }, { "*[^a].t?t", "ab.txt", MATCH }, - { "*[^a]", "", MATCH }, - { "[!ΓΏ]", "", MATCH }, + { "*[^a]", "", NOMATCH }, + { "[!\xFF]", "", NOMATCH }, + { "[!\xFF]", "\xFF", NOMATCH }, + { "[!\xFF]", "a", MATCH }, { "[!?*[]", "?", NOMATCH }, { "[!!]", "!", NOMATCH }, { "[!!]", "x", MATCH }, @@ -130,6 +134,8 @@ static const struct testcase tests[] = { { "[^[:blank:]]", "\t", NOMATCH }, { "[^[:print:]]", "\10", MATCH }, { "[[:lower:]][[:lower:]]", "ll", MATCH }, + { "[[:foo:]]", "bar", NOMATCH }, + { "[[:foo:]]", "f]", MATCH }, { "Curl[[:blank:]];-)", "Curl ;-)", MATCH }, { "*[[:blank:]]*", " ", MATCH }, @@ -167,7 +173,7 @@ static const struct testcase tests[] = { { "x", "", NOMATCH }, /* backslash */ - { "\\", "\\", RE_ERR }, + { "\\", "\\", MATCH }, { "\\\\", "\\", MATCH }, { "\\\\", "\\\\", NOMATCH }, { "\\?", "?", MATCH }, |