]> git.proxmox.com Git - rustc.git/blob - vendor/regex-automata-0.2.0/tests/data/crazy.toml
New upstream version 1.74.1+dfsg1
[rustc.git] / vendor / regex-automata-0.2.0 / tests / data / crazy.toml
1 # TODO: There are still a couple of manually written tests in crazy.rs.
2
3 [[tests]]
4 name = "ranges"
5 regex = '(?-u)\b(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b'
6 input = "num: 255"
7 matches = [[5, 8]]
8
9 [[tests]]
10 name = "ranges-not"
11 regex = '(?-u)\b(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b'
12 input = "num: 256"
13 matches = []
14
15 [[tests]]
16 name = "float1"
17 regex = '[-+]?[0-9]*\.?[0-9]+'
18 input = "0.1"
19 matches = [[0, 3]]
20
21 [[tests]]
22 name = "float2"
23 regex = '[-+]?[0-9]*\.?[0-9]+'
24 input = "0.1.2"
25 matches = [[0, 3]]
26 match_limit = 1
27
28 [[tests]]
29 name = "float3"
30 regex = '[-+]?[0-9]*\.?[0-9]+'
31 input = "a1.2"
32 matches = [[1, 4]]
33
34 [[tests]]
35 name = "float4"
36 regex = '[-+]?[0-9]*\.?[0-9]+'
37 input = "1.a"
38 matches = [[0, 1]]
39
40 [[tests]]
41 name = "float5"
42 regex = '^[-+]?[0-9]*\.?[0-9]+$'
43 input = "1.a"
44 matches = []
45
46 [[tests]]
47 name = "email"
48 regex = '(?i-u)\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b'
49 input = "mine is jam.slam@gmail.com "
50 matches = [[8, 26]]
51
52 [[tests]]
53 name = "email-not"
54 regex = '(?i-u)\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b'
55 input = "mine is jam.slam@gmail "
56 matches = []
57
58 [[tests]]
59 name = "email-big"
60 regex = '''[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?'''
61 input = "mine is jam.slam@gmail.com "
62 matches = [[8, 26]]
63
64 [[tests]]
65 name = "date1"
66 regex = '(?-u)^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$'
67 input = "1900-01-01"
68 matches = [[0, 10]]
69
70 [[tests]]
71 name = "date2"
72 regex = '(?-u)^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$'
73 input = "1900-00-01"
74 matches = []
75
76 [[tests]]
77 name = "date3"
78 regex = '(?-u)^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$'
79 input = "1900-13-01"
80 matches = []
81
82 [[tests]]
83 name = "start-end-empty"
84 regex = '^$'
85 input = ""
86 matches = [[0, 0]]
87
88 [[tests]]
89 name = "start-end-empty-rev"
90 regex = '$^'
91 input = ""
92 matches = [[0, 0]]
93
94 [[tests]]
95 name = "start-end-empty-many-1"
96 regex = '^$^$^$'
97 input = ""
98 matches = [[0, 0]]
99
100 [[tests]]
101 name = "start-end-empty-many-2"
102 regex = '^^^$$$'
103 input = ""
104 matches = [[0, 0]]
105
106 [[tests]]
107 name = "start-end-empty-rep"
108 regex = '(?:^$)*'
109 input = "a\nb\nc"
110 matches = [[0, 0], [1, 1], [2, 2], [3, 3], [4, 4], [5, 5]]
111
112 [[tests]]
113 name = "start-end-empty-rep-rev"
114 regex = '(?:$^)*'
115 input = "a\nb\nc"
116 matches = [[0, 0], [1, 1], [2, 2], [3, 3], [4, 4], [5, 5]]
117
118 [[tests]]
119 name = "neg-class-letter"
120 regex = '[^ac]'
121 input = "acx"
122 matches = [[2, 3]]
123
124 [[tests]]
125 name = "neg-class-letter-comma"
126 regex = '[^a,]'
127 input = "a,x"
128 matches = [[2, 3]]
129
130 [[tests]]
131 name = "neg-class-letter-space"
132 regex = '[^a[:space:]]'
133 input = "a x"
134 matches = [[2, 3]]
135
136 [[tests]]
137 name = "neg-class-comma"
138 regex = '[^,]'
139 input = ",,x"
140 matches = [[2, 3]]
141
142 [[tests]]
143 name = "neg-class-space"
144 regex = '[^[:space:]]'
145 input = " a"
146 matches = [[1, 2]]
147
148 [[tests]]
149 name = "neg-class-space-comma"
150 regex = '[^,[:space:]]'
151 input = ", a"
152 matches = [[2, 3]]
153
154 [[tests]]
155 name = "neg-class-comma-space"
156 regex = '[^[:space:],]'
157 input = " ,a"
158 matches = [[2, 3]]
159
160 [[tests]]
161 name = "neg-class-ascii"
162 regex = '[^[:alpha:]Z]'
163 input = "A1"
164 matches = [[1, 2]]
165
166 [[tests]]
167 name = "lazy-many-many"
168 regex = '((?:.*)*?)='
169 input = "a=b"
170 matches = [[0, 2]]
171
172 [[tests]]
173 name = "lazy-many-optional"
174 regex = '((?:.?)*?)='
175 input = "a=b"
176 matches = [[0, 2]]
177
178 [[tests]]
179 name = "lazy-one-many-many"
180 regex = '((?:.*)+?)='
181 input = "a=b"
182 matches = [[0, 2]]
183
184 [[tests]]
185 name = "lazy-one-many-optional"
186 regex = '((?:.?)+?)='
187 input = "a=b"
188 matches = [[0, 2]]
189
190 [[tests]]
191 name = "lazy-range-min-many"
192 regex = '((?:.*){1,}?)='
193 input = "a=b"
194 matches = [[0, 2]]
195
196 [[tests]]
197 name = "lazy-range-many"
198 regex = '((?:.*){1,2}?)='
199 input = "a=b"
200 matches = [[0, 2]]
201
202 [[tests]]
203 name = "greedy-many-many"
204 regex = '((?:.*)*)='
205 input = "a=b"
206 matches = [[0, 2]]
207
208 [[tests]]
209 name = "greedy-many-optional"
210 regex = '((?:.?)*)='
211 input = "a=b"
212 matches = [[0, 2]]
213
214 [[tests]]
215 name = "greedy-one-many-many"
216 regex = '((?:.*)+)='
217 input = "a=b"
218 matches = [[0, 2]]
219
220 [[tests]]
221 name = "greedy-one-many-optional"
222 regex = '((?:.?)+)='
223 input = "a=b"
224 matches = [[0, 2]]
225
226 [[tests]]
227 name = "greedy-range-min-many"
228 regex = '((?:.*){1,})='
229 input = "a=b"
230 matches = [[0, 2]]
231
232 [[tests]]
233 name = "greedy-range-many"
234 regex = '((?:.*){1,2})='
235 input = "a=b"
236 matches = [[0, 2]]
237
238 [[tests]]
239 name = "empty1"
240 regex = ''
241 input = ""
242 matches = [[0, 0]]
243
244 [[tests]]
245 name = "empty2"
246 regex = ''
247 input = "abc"
248 matches = [[0, 0], [1, 1], [2, 2], [3, 3]]
249
250 [[tests]]
251 name = "empty3"
252 regex = '()'
253 input = "abc"
254 matches = [[0, 0], [1, 1], [2, 2], [3, 3]]
255
256 [[tests]]
257 name = "empty4"
258 regex = '()*'
259 input = "abc"
260 matches = [[0, 0], [1, 1], [2, 2], [3, 3]]
261
262 [[tests]]
263 name = "empty5"
264 regex = '()+'
265 input = "abc"
266 matches = [[0, 0], [1, 1], [2, 2], [3, 3]]
267
268 [[tests]]
269 name = "empty6"
270 regex = '()?'
271 input = "abc"
272 matches = [[0, 0], [1, 1], [2, 2], [3, 3]]
273
274 [[tests]]
275 name = "empty7"
276 regex = '()()'
277 input = "abc"
278 matches = [[0, 0], [1, 1], [2, 2], [3, 3]]
279
280 [[tests]]
281 name = "empty8"
282 regex = '()+|z'
283 input = "abc"
284 matches = [[0, 0], [1, 1], [2, 2], [3, 3]]
285
286 [[tests]]
287 name = "empty9"
288 regex = 'z|()+'
289 input = "abc"
290 matches = [[0, 0], [1, 1], [2, 2], [3, 3]]
291
292 [[tests]]
293 name = "empty10"
294 regex = '()+|b'
295 input = "abc"
296 matches = [[0, 0], [1, 1], [2, 2], [3, 3]]
297
298 [[tests]]
299 name = "empty11"
300 regex = 'b|()+'
301 input = "abc"
302 matches = [[0, 0], [1, 2], [3, 3]]