aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPatrick Monnerat <patrick@monnerat.net>2018-01-29 16:21:50 +0100
committerPatrick Monnerat <patrick@monnerat.net>2018-01-31 01:17:35 +0100
commitfcaa1826bd34c2a7ea7e71bfd2cfdcf5fe3506c1 (patch)
tree7dcb95b7bdc77fdba342b9b61994ccc0b6376d6a /tests
parent19abad095caafb2279f8aeb5d39cd038dcece938 (diff)
fnmatch: accept an alphanum to be followed by a non-alphanum in char set
Also be more tolerant about set pattern syntax. Update unit test 1307 accordingly. Bug: https://curl.haxx.se/mail/lib-2018-01/0114.html
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/unit1307.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/unit/unit1307.c b/tests/unit/unit1307.c
index eff5edebc..5aa23d0dc 100644
--- a/tests/unit/unit1307.c
+++ b/tests/unit/unit1307.c
@@ -36,8 +36,8 @@ struct testcase {
static const struct testcase tests[] = {
/* brackets syntax */
{ "\\[", "[", MATCH },
- { "[", "[", RE_ERR },
- { "[]", "[]", RE_ERR },
+ { "[", "[", MATCH },
+ { "[]", "[]", MATCH },
{ "[][]", "[", MATCH },
{ "[][]", "]", MATCH },
{ "[[]", "[", MATCH },
@@ -49,6 +49,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 +79,7 @@ static const struct testcase tests[] = {
{ "[][?*-]", "*", MATCH },
{ "[][?*-]", "-", MATCH },
{ "[]?*-]", "-", MATCH },
+ { "[\xFF]", "\xFF", MATCH },
{ "?/b/c", "a/b/c", MATCH },
{ "^_{}~", "^_{}~", MATCH },
{ "!#%+,-./01234567889", "!#%+,-./01234567889", MATCH },
@@ -98,7 +101,9 @@ static const struct testcase tests[] = {
{ "*[^a].t?t", "ba.txt", NOMATCH },
{ "*[^a].t?t", "ab.txt", MATCH },
{ "*[^a]", "", NOMATCH },
- { "[!ΓΏ]", "", NOMATCH },
+ { "[!\xFF]", "", NOMATCH },
+ { "[!\xFF]", "\xFF", NOMATCH },
+ { "[!\xFF]", "a", MATCH },
{ "[!?*[]", "?", NOMATCH },
{ "[!!]", "!", NOMATCH },
{ "[!!]", "x", MATCH },