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: 0 1 deep/foo/bar/baz/ **/bar/*
54: 1 1 deep/foo/bar/baz/ **/bar/**
55: 0 1 deep/foo/bar **/bar/*
56: 1 1 deep/foo/bar/ **/bar/**
57: 1 1 foo/bar/baz **/bar**
58: 1 1 foo/bar/baz/x */bar/**
59: 0 0 deep/foo/bar/baz/x */bar/**
60: 1 1 deep/foo/bar/baz/x **/bar/*/*
61:
62: # Various additional tests
63: 0 1 acrt a[c-c]st
64: 1 1 acrt a[c-c]rt
65: 0 1 ] [!]-]
66: 1 1 a [!]-]
67: 0 1 '' \
68: 0 1 \ \
69: 0 1 /\ */\
70: 1 1 /\ */\\
71: 1 1 foo foo
72: 1 1 @foo @foo
73: 0 1 foo @foo
74: 1 1 [ab] \[ab]
75: 1 1 [ab] [[]ab]
76: 1 1 [ab] [[:]ab]
77: 0 1 [ab] [[::]ab]
78: 1 1 [ab] [[:digit]ab]
79: 1 1 [ab] [\[:]ab]
80: 1 1 ?a?b \??\?b
81: 1 1 abc \a\b\c
82: 0 1 foo ''
83: 1 1 foo/bar/baz/to **/t[o]
84:
85: # Character class tests
86: 1 1 a1B [[:alpha:]][[:digit:]][[:upper:]]
87: 0 1 a [[:digit:][:upper:][:space:]]
88: 1 1 A [[:digit:][:upper:][:space:]]
89: 1 1 1 [[:digit:][:upper:][:space:]]
90: 0 1 1 [[:digit:][:upper:][:spaci:]]
91: 1 1 ' ' [[:digit:][:upper:][:space:]]
92: 0 1 . [[:digit:][:upper:][:space:]]
93: 1 1 . [[:digit:][:punct:][:space:]]
94: 1 1 5 [[:xdigit:]]
95: 1 1 f [[:xdigit:]]
96: 1 1 D [[:xdigit:]]
97: 1 1 _ [[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:xdigit:]]
98: #1 1 … [^[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:xdigit:]]
99: 1 1 [^[:alnum:][:alpha:][:blank:][:digit:][:graph:][:lower:][:print:][:punct:][:space:][:upper:][:xdigit:]]
100: 1 1 . [^[:alnum:][:alpha:][:blank:][:cntrl:][:digit:][:lower:][:space:][:upper:][:xdigit:]]
101: 1 1 5 [a-c[:digit:]x-z]
102: 1 1 b [a-c[:digit:]x-z]
103: 1 1 y [a-c[:digit:]x-z]
104: 0 1 q [a-c[:digit:]x-z]
105:
106: # Additional tests, including some malformed wildmats
107: 1 1 ] [\\-^]
108: 0 1 [ [\\-^]
109: 1 1 - [\-_]
110: 1 1 ] [\]]
111: 0 1 \] [\]]
112: 0 1 \ [\]]
113: 0 1 ab a[]b
114: 0 1 a[]b a[]b
115: 0 1 ab[ ab[
116: 0 1 ab [!
117: 0 1 ab [-
118: 1 1 - [-]
119: 0 1 - [a-
120: 0 1 - [!a-
121: 1 1 - [--A]
122: 1 1 5 [--A]
123: 1 1 ' ' '[ --]'
124: 1 1 $ '[ --]'
125: 1 1 - '[ --]'
126: 0 1 0 '[ --]'
127: 1 1 - [---]
128: 1 1 - [------]
129: 0 1 j [a-e-n]
130: 1 1 - [a-e-n]
131: 1 1 a [!------]
132: 0 1 [ []-a]
133: 1 1 ^ []-a]
134: 0 1 ^ [!]-a]
135: 1 1 [ [!]-a]
136: 1 1 ^ [a^bc]
137: 1 1 -b] [a-]b]
138: 0 1 \ [\]
139: 1 1 \ [\\]
140: 0 1 \ [!\\]
141: 1 1 G [A-\\]
142: 0 1 aaabbb b*a
143: 0 1 aabcaa *ba*
144: 1 1 , [,]
145: 1 1 , [\\,]
146: 1 1 \ [\\,]
147: 1 1 - [,-.]
148: 0 1 + [,-.]
149: 0 1 -.] [,-.]
150: 1 1 2 [\1-\3]
151: 1 1 3 [\1-\3]
152: 0 1 4 [\1-\3]
153: 1 1 \ [[-\]]
154: 1 1 [ [[-\]]
155: 1 1 ] [[-\]]
156: 0 1 - [[-\]]
157:
158: # Test recursion and the abort code (use "wildtest -i" to see iteration counts)
159: 1 1 -adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1 -*-*-*-*-*-*-12-*-*-*-m-*-*-*
160: 0 1 -adobe-courier-bold-o-normal--12-120-75-75-X-70-iso8859-1 -*-*-*-*-*-*-12-*-*-*-m-*-*-*
161: 0 1 -adobe-courier-bold-o-normal--12-120-75-75-/-70-iso8859-1 -*-*-*-*-*-*-12-*-*-*-m-*-*-*
162: 1 1 /adobe/courier/bold/o/normal//12/120/75/75/m/70/iso8859/1 /*/*/*/*/*/*/12/*/*/*/m/*/*/*
163: 0 1 /adobe/courier/bold/o/normal//12/120/75/75/X/70/iso8859/1 /*/*/*/*/*/*/12/*/*/*/m/*/*/*
164: 1 1 abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txt **/*a*b*g*n*t
165: 0 1 abcd/abcdefg/abcdefghijk/abcdefghijklmnop.txtz **/*a*b*g*n*t
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>