Commit | Line | Data |
---|---|---|
97d53f8c WD |
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 | |
4 | # to succeed and if fnmatch works the same way as wildmat, respectively. | |
5 | # After that is a text string for the match, and a pattern string. Strings | |
6 | # can be quoted 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 | 1 0 foo/bar foo[/]bar | |
45 | 0 1 foo **/foo | |
46 | 1 1 /foo **/foo | |
47 | 1 1 bar/baz/foo **/foo | |
48 | 0 1 bar/baz/foo */foo | |
49 | 0 0 foo/bar/baz **/bar* | |
50 | 1 1 foo/bar/baz **/bar** | |
51 | ||
52 | # Various additional tests | |
53 | 0 1 acrt a[c-c]st | |
54 | 0 1 ] [!]-] | |
55 | 1 1 a [!]-] | |
56 | 0 1 '' \ | |
57 | 0 1 \ \ | |
58 | 1 1 foo foo | |
59 | 1 1 @foo @foo | |
60 | 0 1 foo @foo | |
61 | 1 1 [ab] \[ab] | |
62 | 1 1 ?a?b \??\?b | |
63 | 1 1 abc \a\b\c | |
64 | 0 1 foo '' | |
65 | 1 1 foo/bar/baz/to **/t[o] | |
66 | ||
67 | # Character class tests | |
68 | 1 1 a1B [[:alpha:]][[:digit:]][[:upper:]] | |
69 | 0 1 a [[:digit:][:upper:][:space:]] | |
70 | 1 1 A [[:digit:][:upper:][:space:]] | |
71 | 1 1 1 [[:digit:][:upper:][:space:]] | |
72 | 1 1 ' ' [[:digit:][:upper:][:space:]] | |
73 | 0 1 . [[:digit:][:upper:][:space:]] | |
74 | 1 1 5 [[:xdigit:]] | |
75 | 1 1 f [[:xdigit:]] | |
76 | 1 1 D [[:xdigit:]] | |
77 | ||
78 | # Additional tests, including some malformed wildmats | |
79 | 1 1 ] [\\-^] | |
80 | 0 1 [ [\\-^] | |
81 | 1 1 - [\-_] | |
82 | 1 1 ] [\]] | |
83 | 0 1 \] [\]] | |
84 | 0 1 \ [\]] | |
85 | 0 1 ab a[]b | |
86 | 0 1 a[]b a[]b | |
87 | 0 1 ab[ ab[ | |
88 | 0 1 ab [! | |
89 | 0 1 ab [- | |
90 | 1 1 - [-] | |
91 | 0 1 - [a- | |
92 | 0 1 - [!a- | |
93 | 1 1 - [--A] | |
94 | 1 1 5 [--A] | |
95 | 1 1 ' ' '[ --]' | |
96 | 1 1 $ '[ --]' | |
97 | 1 1 - '[ --]' | |
98 | 0 1 0 '[ --]' | |
99 | 1 1 - [---] | |
100 | 1 1 - [------] | |
101 | 0 1 j [a-e-n] | |
102 | 1 1 - [a-e-n] | |
103 | 1 1 a [!------] | |
104 | 0 1 [ []-a] | |
105 | 1 1 ^ []-a] | |
106 | 0 1 ^ [!]-a] | |
107 | 1 1 [ [!]-a] | |
108 | 1 1 ^ [a^bc] | |
109 | 1 1 -b] [a-]b] | |
110 | 0 1 \ [\] | |
111 | 1 1 \ [\\] | |
112 | 0 1 \ [!\\] | |
113 | 1 1 G [A-\\] | |
114 | 0 1 aaabbb b*a | |
115 | 0 1 aabcaa *ba* | |
116 | 1 1 , [,] | |
117 | 1 1 , [\\,] | |
118 | 1 1 \ [\\,] | |
119 | 1 1 - [,-.] | |
120 | 0 1 + [,-.] | |
121 | 0 1 -.] [,-.] | |
122 | 1 1 \ [[-\]] | |
123 | 0 1 - [[-\]] | |
124 | ||
125 | # Test recursive calls and the ABORT code | |
126 | 1 1 -adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1 -*-*-*-*-*-*-12-*-*-*-m-*-*-* | |
127 | 0 1 -adobe-courier-bold-o-normal--12-120-75-75-X-70-iso8859-1 -*-*-*-*-*-*-12-*-*-*-m-*-*-* | |
128 | 0 1 -adobe-courier-bold-o-normal--12-120-75-75-/-70-iso8859-1 -*-*-*-*-*-*-12-*-*-*-m-*-*-* | |
129 | 1 1 /adobe/courier/bold/o/normal//12/120/75/75/m/70/iso8859/1 /*/*/*/*/*/*/12/*/*/*/m/*/*/* | |
130 | 0 1 /adobe/courier/bold/o/normal//12/120/75/75/X/70/iso8859/1 /*/*/*/*/*/*/12/*/*/*/m/*/*/* | |
131 | 1 1 abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txt **/*a*b*g*n*t |