| 1 | # Input is in the following format (all items white-space separated): |
| 2 | # |
| 3 | # The first two items are 1 or 0 indicating if the wildmat call is expected to |
| 4 | # succeed and if fnmatch works the same way as wildmat, respectively. After |
| 5 | # that is a text string for the match, and a pattern string. Strings can be |
| 6 | # quoted (if desired) in either double or single quotes, as well as backticks. |
| 7 | # |
| 8 | # MATCH FNMATCH_SAME "text to match" 'pattern to use' |
| 9 | |
| 10 | # Basic wildmat features |
| 11 | 1 1 foo foo |
| 12 | 0 1 foo bar |
| 13 | 1 1 '' "" |
| 14 | 1 1 foo ??? |
| 15 | 0 1 foo ?? |
| 16 | 1 1 foo * |
| 17 | 1 1 foo f* |
| 18 | 0 1 foo *f |
| 19 | 1 1 foo *foo* |
| 20 | 1 1 foobar *ob*a*r* |
| 21 | 1 1 aaaaaaabababab *ab |
| 22 | 1 1 foo* foo\* |
| 23 | 0 1 foobar foo\*bar |
| 24 | 1 1 f\oo f\\oo |
| 25 | 1 1 ball *[al]? |
| 26 | 0 1 ten [ten] |
| 27 | 1 1 ten **[!te] |
| 28 | 0 1 ten **[!ten] |
| 29 | 1 1 ten t[a-g]n |
| 30 | 0 1 ten t[!a-g]n |
| 31 | 1 1 ton t[!a-g]n |
| 32 | 1 1 ton t[^a-g]n |
| 33 | 1 1 a]b a[]]b |
| 34 | 1 1 a-b a[]-]b |
| 35 | 1 1 a]b a[]-]b |
| 36 | 0 1 aab a[]-]b |
| 37 | 1 1 aab a[]a-]b |
| 38 | 1 1 ] ] |
| 39 | |
| 40 | # Extended slash-matching features |
| 41 | 0 1 foo/baz/bar foo*bar |
| 42 | 1 1 foo/baz/bar foo**bar |
| 43 | 0 1 foo/bar foo?bar |
| 44 | 0 1 foo/bar foo[/]bar |
| 45 | 0 1 foo/bar f[^eiu][^eiu][^eiu][^eiu][^eiu]r |
| 46 | 1 1 foo-bar f[^eiu][^eiu][^eiu][^eiu][^eiu]r |
| 47 | 0 1 foo **/foo |
| 48 | 1 1 /foo **/foo |
| 49 | 1 1 bar/baz/foo **/foo |
| 50 | 0 1 bar/baz/foo */foo |
| 51 | 0 0 foo/bar/baz **/bar* |
| 52 | 1 1 deep/foo/bar/baz **/bar/* |
| 53 | 1 1 foo/bar/baz **/bar** |
| 54 | 1 1 foo/bar/baz/x */bar/** |
| 55 | 0 0 deep/foo/bar/baz/x */bar/** |
| 56 | 1 1 deep/foo/bar/baz/x **/bar/*/* |
| 57 | |
| 58 | # Various additional tests |
| 59 | 0 1 acrt a[c-c]st |
| 60 | 1 1 acrt a[c-c]rt |
| 61 | 0 1 ] [!]-] |
| 62 | 1 1 a [!]-] |
| 63 | 0 1 '' \ |
| 64 | 0 1 \ \ |
| 65 | 0 1 /\ */\ |
| 66 | 1 1 /\ */\\ |
| 67 | 1 1 foo foo |
| 68 | 1 1 @foo @foo |
| 69 | 0 1 foo @foo |
| 70 | 1 1 [ab] \[ab] |
| 71 | 1 1 [ab] [[]ab] |
| 72 | 1 1 [ab] [[:]ab] |
| 73 | 0 1 [ab] [[::]ab] |
| 74 | 1 1 [ab] [[:digit]ab] |
| 75 | 1 1 [ab] [\[:]ab] |
| 76 | 1 1 ?a?b \??\?b |
| 77 | 1 1 abc \a\b\c |
| 78 | 0 1 foo '' |
| 79 | 1 1 foo/bar/baz/to **/t[o] |
| 80 | |
| 81 | # Character class tests |
| 82 | 1 1 a1B [[:alpha:]][[:digit:]][[:upper:]] |
| 83 | 0 1 a [[:digit:][:upper:][:space:]] |
| 84 | 1 1 A [[:digit:][:upper:][:space:]] |
| 85 | 1 1 1 [[:digit:][:upper:][:space:]] |
| 86 | 0 1 1 [[:digit:][:upper:][:spaci:]] |
| 87 | 1 1 ' ' [[:digit:][:upper:][:space:]] |
| 88 | 0 1 . [[:digit:][:upper:][:space:]] |
| 89 | 1 1 . [[:digit:][:punct:][:space:]] |
| 90 | 1 1 5 [[:xdigit:]] |
| 91 | 1 1 f [[:xdigit:]] |
| 92 | 1 1 D [[:xdigit:]] |
| 93 | 1 1 _ [[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:xdigit:]] |
| 94 |