summaryrefslogtreecommitdiff
path: root/regress/lib/libc/fnmatch/fnm_test.in
blob: c2f218ae1b3f7a485403dc10ab123f67acdee4ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
/bin/[[:alpha:][:alnum:]]* /bin/ls 0x2 0
/bin/[[:upper:]][[:alnum:]] /bin/ls 0x10 0
/bin/[[:opper:][:alnum:]]* /bin/ls 0x0 1
[[:alpha:][:alnum:]]*.c foo1.c 0x4 0
[[:upper:]]* FOO 0x0 0
[![:space:]]* bar 0x0 0
# 'te\st' 'test'; no match if FNM_NOESCAPE
te\st test 0x0 0  
te\st test 0x1 1
te\st test 0x1e 0
# 'te\\st' 'te\st'; no match if FNM_NOESCAPE
te\\st te\st 0x0 0
te\\st te\st 0x1 1
te\\st te\st 0x1e 0
# 'te\*t' 'te*t'; no match if FNM_NOESCAPE
te\*t te*t 0x0 0
te\*t te*t 0x1 1
te\*t te*t 0x1e 0
# 'te\*t' 'test'; no match
te\*t test 0x0 1
te\*t test 0x1f 1
# 'te\?t' 'te?t'; no match if FNM_NOESCAPE
te\?t te?t 0x0 0
te\?t te?t 0x1 1
te\?t te?t 0x1e 0
# 'te\?t' 'test'; no match
te\?t test 0x0 1
te\?t test 0x1f 1
# 'tesT' 'test'; match if FNM_CASEFOLD
tesT test 0x0 1
tesT test 0xf 1
tesT test 0x10 0
# 'test' 'Test'; match if FNM_CASEFOLD
test Test 0x0 1
test Test 0xf 1
test Test 0x10 0
# 'tEst' 'teSt'; match if FNM_CASEFOLD
tEst teSt 0x0 1
tEst teSt 0xf 1
tEst teSt 0x10 0
# '?est' 'test'; match always
?est test 0x0 0
?est test 0x1f 0
# 'te?t' 'test'; match always
te?t test 0x0 0
te?t test 0x1f 0
# 'tes?' 'test'; match always
tes? test 0x0 0
tes? test 0x1f 0
# 'test?' 'test'; no match
test? test 0x0 1
test? test 0x1f 1
# '*' always matches anything
*  test 0x0 0
*  test 0x1f 0
# '*test' 'test'; match always
*test test 0x0 0
*test test 0x1f 0
# '*est' 'test'; match always
*est test 0x0 0
*est test 0x1f 0
# '*st' 'test'; match always
*st test 0x0 0
*st test 0x1f 0
# 't*t' 'test'; match always
t*t test 0x0 0
t*t test 0x1f 0
# 'te*t' 'test'; match always
te*t test 0x0 0
te*t test 0x1f 0
# 'te*st' 'test'; match always
te*st test 0x0 0
te*st test 0x1f 0
# 'te*' 'test'; match always
te* test 0x0 0
te* test 0x1f 0
# 'tes*' 'test'; match always
tes* test 0x0 0
tes* test 0x1f 0
# 'test*' 'test'; match always
test* test 0x0 0
test* test 0x1f 0
# '.[\-\t]' '.t'; match always
.[\-\t] .t 0x0 0
.[\-\t] .t 0x1f 0
# 'test*?*[a-z]*' 'testgoop'; match always
test*?*[a-z]* testgoop 0x0 0
test*?*[a-z]* testgoop 0x1f 0
# 'te[^abc]t' 'test'; match always
te[^abc]t test 0x0 0
te[^abc]t test 0x1f 0
# 'te[^x]t' 'test'; match always
te[^x]t test 0x0 0
te[^x]t test 0x1f 0
# 'te[!x]t' 'test'; match always
te[!x]t test 0x0 0
te[^x]t test 0x1f 0
# 'te[^x]t' 'text'; no match
te[^x]t text 0x0 1
te[^x]t text 0x1f 1
# 'te[^\x]t' 'text'; no match
te[^\x]t text 0x0 1
te[^\x]t text 0x1f 1
# 'te[^\x' 'text'; no match
te[^\x text 0x0 1
te[^\x text 0x1f 1
# 'te[/]t' 'text'; no match
te[/]t text 0x0 1
te[/]t text 0x1f 1
# 'te[S]t' 'test'; match if FNM_CASEFOLD
te[S]t test 0x0 1
te[S]t test 0xf 1
te[S]t test 0x10 0
# 'te[r-t]t' 'test'; match always
te[r-t]t test 0x0 0
te[r-t]t test 0x1f 0
# 'te[r-t]t' 'teSt'; match if FNM_CASEFOLD
te[r-t]t teSt 0x0 1
te[r-t]t teSt 0xf 1
te[r-t]t teSt 0x10 0
# 'te[r-T]t' 'test'; match if FNM_CASEFOLD
te[r-T]t test 0x0 1
te[r-T]t test 0xf 1
te[r-T]t test 0x10 0
# 'te[R-T]t' 'test'; match if FNM_CASEFOLD
te[R-T]t test 0x0 1
te[R-T]t test 0xf 1
te[R-T]t test 0x10 0
# 'te[r-Tz]t' 'tezt'; match always
te[r-Tz]t tezt 0x0 0
te[r-Tz]t tezt 0x1f 0
# 'te[R-T]t' 'tent'; no match
te[R-T]t tent 0x0 1
te[R-T]t tent 0x1f 1
# 'tes[]t]' 'test'; match always
tes[]t] test 0x0 0
tes[]t] test 0x1f 0
# 'tes[t-]' 'test'; match always
tes[t-] test 0x0 0
tes[t-] test 0x1f 0
# 'tes[t-]]' 'test]'; match always
tes[t-]] test] 0x0 0
tes[t-]] test] 0x1f 0
# 'tes[t-]]' 'test'; no match
tes[t-]] test 0x0 1
tes[t-]] test 0x1f 1
# 'tes[u-]' 'test'; no match
tes[u-] test 0x0 1
tes[u-] test 0x1f 1
# 'tes[t-]' 'tes[t-]'; no match
tes[t-] test[t-] 0x0 1
tes[t-] test[t-] 0x1f 1
# 'test[/-/]' 'test[/-/]'; no match
test[/-/] test/-/ 0x0 1
test[/-/] test/-/ 0x1f 1
# 'test[\/-/]' 'test[/-/]'; no match
test[\/-/] test/-/ 0x0 1
test[\/-/] test/-/ 0x1f 1
# 'test[/-\/]' 'test[/-/]'; no match
test[/-\/] test/-/ 0x0 1
test[/-\/] test/-/ 0x1f 1
# 'test[/-/]' 'test/'; no match if APR_FNM_PATHNAME
test[/-/] test/ 0x0 0
test[/-/] test/ 0x2 1
test[/-/] test/ 0x1d 0
# 'test[\/-/]' 'test/'; no match if APR_FNM_PATHNAME
test[\/-/] test/ 0x0 0
test[\/-/] test/ 0x2 1
test[\/-/] test/ 0x1d 0
# 'test[/-\/]' 'test/'; no match if APR_FNM_PATHNAME
test[/-\/] test/ 0x0 0
test[/-\/] test/ 0x2 1
test[/-\/] test/ 0x1d 0
# '/test' 'test'; no match
/test test 0x0 1
/test test 0x1f 1
# 'test' '/test'; no match
test /test 0x0 1
test /test 0x1f 1
# 'test/' 'test'; no match
test/ test 0x0 1
test/ test 0x1f 1
# 'test' 'test/'; match if FNM_LEADING_DIR
test test/ 0x0 1
test test/ 0x17 1
test test/ 0x8 0
# '\/test' '/test'; match unless FNM_NOESCAPE
\/test /test 0x0 0
\/test /test 0x1 1
\/test /test 0x1e 0
# '*test' '/test'; match unless FNM_PATHNAME
*test /test 0x0 0
*test /test 0x2 1
*test /test 0x1d 0
# '/*/test' '/test'; no match
/*/test /test 0x0 1
/*/test /test 0x1f 1
# '/*/test' '/test/test'; match always
/*/test /test/test 0x0 0
/*/test /test/test 0x1f 0
# 'test/this' 'test/'; match never
test/this test/ 0x0 1
test/this test/ 0x1f 1
# 'test/' 'test/this'; match never
test/ test/this 0x0 1
test/ test/this 0x1f 1
# 'test*/this' 'test/this'; match always
test*/this test/this 0x0 0
test*/this test/this 0x1f 0
# 'test*/this' 'test/that'; match never
test*/this test/that 0x0 1
test*/this test/that 0x1f 1
# 'test/*this' 'test/this'; match always
test/*this test/this 0x0 0
test/*this test/this 0x1f 0
# '.*' '.this'; match always
.* .this 0x0 0
.* .this 0x1f 0
# '*' '.this'; fails if FNM_PERIOD
* .this 0x0 0
* .this 0x4 1
* .this 0x1b 0
# '?this' '.this'; fails if FNM_PERIOD
?this .this 0x0 0
?this .this 0x4 1
?this .this 0x1b 0
# '[.]this' '.this'; fails if FNM_PERIOD
[.]this .this 0x0 0
[.]this .this 0x4 1
[.]this .this 0x1b 0
# 'test/this' 'test/this'; match always
test/this test/this 0x0 0
test/this test/this 0x1f 0
# 'test?this' 'test/this'; fails if FNM_PATHNAME
test?this test/this 0x0 0
test?this test/this 0x2 1
test?this test/this 0x1d 0
# 'test*this' 'test/this'; fails if FNM_PATHNAME
test*this test/this 0x0 0
test*this test/this 0x2 1
test*this test/this 0x1d 0
# 'test[/]this' 'test/this'; fails if FNM_PATHNAME
test[/]this test/this 0x0 0
test[/]this test/this 0x2 1
test[/]this test/this 0x1d 0
# 'test/.*' 'test/.this'; match always
test/.* test/.this 0x0 0
test/.* test/.this 0x1f 0
# 'test/*' 'test/.this'; fails if FNM_PERIOD and FNM_PATHNAME
test/* test/.this 0x0 0
test/* test/.this 0x6 1
test/* test/.this 0x19 0
# 'test/?' 'test/.this'; fails if FNM_PERIOD and FNM_PATHNAME
test/?this test/.this 0x0 0
test/?this test/.this 0x6 1
test/?this test/.this 0x19 0
# 'test/[.]this' 'test/.this'; fails if FNM_PERIOD and FNM_PATHNAME
test/[.]this test/.this 0x0 0
test/[.]this test/.this 0x6 1
test/[.]this test/.this 0x19 0