aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPatrick Monnerat <patrick@monnerat.net>2018-01-30 20:22:17 +0100
committerPatrick Monnerat <patrick@monnerat.net>2018-01-31 01:17:35 +0100
commitda5f4b1d84a6aef9ae35274a417f8fb3853a4a90 (patch)
tree7573b573dece263b4da943b69a832288dfdb37b0 /tests
parentfcaa1826bd34c2a7ea7e71bfd2cfdcf5fe3506c1 (diff)
fnmatch: pattern syntax can no longer fail
Whenever an expected pattern syntax rule cannot be matched, the character starting the rule loses its special meaning and the parsing is resumed: - backslash at the end of pattern string matches itself. - Error in [:keyword:] results in set containing :\[dekorwy. Unit test 1307 updated for this new situation. Closes #2273
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/unit1307.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/unit/unit1307.c b/tests/unit/unit1307.c
index 5aa23d0dc..0d2257bf0 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;
@@ -135,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 },
@@ -172,7 +173,7 @@ static const struct testcase tests[] = {
{ "x", "", NOMATCH },
/* backslash */
- { "\\", "\\", RE_ERR },
+ { "\\", "\\", MATCH },
{ "\\\\", "\\", MATCH },
{ "\\\\", "\\\\", NOMATCH },
{ "\\?", "?", MATCH },