• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# These are:
2#
3# (1) Tests of the match-limiting features. The results are different for
4# interpretive or JIT matching, so this test should not be run with JIT. The
5# same tests are run using JIT in test 17.
6
7# (2) Other tests that must not be run with JIT.
8
9/(a+)*zz/I
10Capturing subpattern count = 1
11Starting code units: a z
12Last code unit = 'z'
13Subject length lower bound = 2
14  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits
15Minimum heap limit = 0
16Minimum match limit = 7
17Minimum depth limit = 7
18 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz
19 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
20  aaaaaaaaaaaaaz\=find_limits
21Minimum heap limit = 0
22Minimum match limit = 20481
23Minimum depth limit = 30
24No match
25
26!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I
27Capturing subpattern count = 1
28May match empty string
29Subject length lower bound = 0
30   /* this is a C style comment */\=find_limits
31Minimum heap limit = 0
32Minimum match limit = 64
33Minimum depth limit = 7
34 0: /* this is a C style comment */
35 1: /* this is a C style comment */
36
37/^(?>a)++/
38    aa\=find_limits
39Minimum heap limit = 0
40Minimum match limit = 5
41Minimum depth limit = 3
42 0: aa
43    aaaaaaaaa\=find_limits
44Minimum heap limit = 0
45Minimum match limit = 12
46Minimum depth limit = 3
47 0: aaaaaaaaa
48
49/(a)(?1)++/
50    aa\=find_limits
51Minimum heap limit = 0
52Minimum match limit = 7
53Minimum depth limit = 5
54 0: aa
55 1: a
56    aaaaaaaaa\=find_limits
57Minimum heap limit = 0
58Minimum match limit = 21
59Minimum depth limit = 5
60 0: aaaaaaaaa
61 1: a
62
63/a(?:.)*?a/ims
64    abbbbbbbbbbbbbbbbbbbbba\=find_limits
65Minimum heap limit = 0
66Minimum match limit = 24
67Minimum depth limit = 3
68 0: abbbbbbbbbbbbbbbbbbbbba
69
70/a(?:.(*THEN))*?a/ims
71    abbbbbbbbbbbbbbbbbbbbba\=find_limits
72Minimum heap limit = 0
73Minimum match limit = 66
74Minimum depth limit = 45
75 0: abbbbbbbbbbbbbbbbbbbbba
76
77/a(?:.(*THEN:ABC))*?a/ims
78    abbbbbbbbbbbbbbbbbbbbba\=find_limits
79Minimum heap limit = 0
80Minimum match limit = 66
81Minimum depth limit = 45
82 0: abbbbbbbbbbbbbbbbbbbbba
83
84/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
85     aabbccddee\=find_limits
86Minimum heap limit = 0
87Minimum match limit = 7
88Minimum depth limit = 7
89 0: aabbccddee
90
91/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
92     aabbccddee\=find_limits
93Minimum heap limit = 0
94Minimum match limit = 12
95Minimum depth limit = 12
96 0: aabbccddee
97 1: aa
98 2: bb
99 3: cc
100 4: dd
101 5: ee
102
103/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
104     aabbccddee\=find_limits
105Minimum heap limit = 0
106Minimum match limit = 10
107Minimum depth limit = 10
108 0: aabbccddee
109 1: aa
110 2: cc
111 3: ee
112
113/(*LIMIT_MATCH=12bc)abc/
114Failed: error 160 at offset 17: (*VERB) not recognized or malformed
115
116/(*LIMIT_MATCH=4294967290)abc/
117Failed: error 160 at offset 24: (*VERB) not recognized or malformed
118
119/(*LIMIT_DEPTH=4294967280)abc/I
120Capturing subpattern count = 0
121Depth limit = 4294967280
122First code unit = 'a'
123Last code unit = 'c'
124Subject length lower bound = 3
125
126/(a+)*zz/
127\= Expect no match
128    aaaaaaaaaaaaaz
129No match
130\= Expect limit exceeded
131    aaaaaaaaaaaaaz\=match_limit=3000
132Failed: error -47: match limit exceeded
133
134/(a+)*zz/
135\= Expect limit exceeded
136    aaaaaaaaaaaaaz\=depth_limit=10
137Failed: error -53: matching depth limit exceeded
138
139/(*LIMIT_MATCH=3000)(a+)*zz/I
140Capturing subpattern count = 1
141Match limit = 3000
142Starting code units: a z
143Last code unit = 'z'
144Subject length lower bound = 2
145\= Expect limit exceeded
146    aaaaaaaaaaaaaz
147Failed: error -47: match limit exceeded
148\= Expect limit exceeded
149    aaaaaaaaaaaaaz\=match_limit=60000
150Failed: error -47: match limit exceeded
151
152/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
153Capturing subpattern count = 1
154Match limit = 3000
155Starting code units: a z
156Last code unit = 'z'
157Subject length lower bound = 2
158\= Expect limit exceeded
159    aaaaaaaaaaaaaz
160Failed: error -47: match limit exceeded
161
162/(*LIMIT_MATCH=60000)(a+)*zz/I
163Capturing subpattern count = 1
164Match limit = 60000
165Starting code units: a z
166Last code unit = 'z'
167Subject length lower bound = 2
168\= Expect no match
169    aaaaaaaaaaaaaz
170No match
171\= Expect limit exceeded
172    aaaaaaaaaaaaaz\=match_limit=3000
173Failed: error -47: match limit exceeded
174
175/(*LIMIT_DEPTH=10)(a+)*zz/I
176Capturing subpattern count = 1
177Depth limit = 10
178Starting code units: a z
179Last code unit = 'z'
180Subject length lower bound = 2
181\= Expect limit exceeded
182    aaaaaaaaaaaaaz
183Failed: error -53: matching depth limit exceeded
184\= Expect limit exceeded
185    aaaaaaaaaaaaaz\=depth_limit=1000
186Failed: error -53: matching depth limit exceeded
187
188/(*LIMIT_DEPTH=10)(*LIMIT_DEPTH=1000)(a+)*zz/I
189Capturing subpattern count = 1
190Depth limit = 1000
191Starting code units: a z
192Last code unit = 'z'
193Subject length lower bound = 2
194\= Expect no match
195    aaaaaaaaaaaaaz
196No match
197
198/(*LIMIT_DEPTH=1000)(a+)*zz/I
199Capturing subpattern count = 1
200Depth limit = 1000
201Starting code units: a z
202Last code unit = 'z'
203Subject length lower bound = 2
204\= Expect no match
205    aaaaaaaaaaaaaz
206No match
207\= Expect limit exceeded
208    aaaaaaaaaaaaaz\=depth_limit=10
209Failed: error -53: matching depth limit exceeded
210
211# These three have infinitely nested recursions.
212
213/((?2))((?1))/
214    abc
215Failed: error -52: nested recursion at the same subject position
216
217/((?(R2)a+|(?1)b))()/
218    aaaabcde
219Failed: error -52: nested recursion at the same subject position
220
221/(?(R)a*(?1)|((?R))b)/
222    aaaabcde
223Failed: error -52: nested recursion at the same subject position
224
225# The allusedtext modifier does not work with JIT, which does not maintain
226# the leftchar/rightchar data.
227
228/abc(?=xyz)/allusedtext
229    abcxyzpqr
230 0: abcxyz
231       >>>
232    abcxyzpqr\=aftertext
233 0: abcxyz
234       >>>
235 0+ xyzpqr
236
237/(?<=pqr)abc(?=xyz)/allusedtext
238    xyzpqrabcxyzpqr
239 0: pqrabcxyz
240    <<<   >>>
241    xyzpqrabcxyzpqr\=aftertext
242 0: pqrabcxyz
243    <<<   >>>
244 0+ xyzpqr
245
246/a\b/
247    a.\=allusedtext
248 0: a.
249     >
250    a\=allusedtext
251 0: a
252
253/abc\Kxyz/
254    abcxyz\=allusedtext
255 0: abcxyz
256    <<<
257
258/abc(?=xyz(*ACCEPT))/
259    abcxyz\=allusedtext
260 0: abcxyz
261       >>>
262
263/abc(?=abcde)(?=ab)/allusedtext
264    abcabcdefg
265 0: abcabcde
266       >>>>>
267
268# These tests provoke recursion loops, which give a different error message
269# when JIT is used.
270
271/(?R)/I
272Capturing subpattern count = 0
273May match empty string
274Subject length lower bound = 0
275    abcd
276Failed: error -52: nested recursion at the same subject position
277
278/(a|(?R))/I
279Capturing subpattern count = 1
280May match empty string
281Subject length lower bound = 0
282    abcd
283 0: a
284 1: a
285    defg
286Failed: error -52: nested recursion at the same subject position
287
288/(ab|(bc|(de|(?R))))/I
289Capturing subpattern count = 3
290May match empty string
291Subject length lower bound = 0
292    abcd
293 0: ab
294 1: ab
295    fghi
296Failed: error -52: nested recursion at the same subject position
297
298/(ab|(bc|(de|(?1))))/I
299Capturing subpattern count = 3
300May match empty string
301Subject length lower bound = 0
302    abcd
303 0: ab
304 1: ab
305    fghi
306Failed: error -52: nested recursion at the same subject position
307
308/x(ab|(bc|(de|(?1)x)x)x)/I
309Capturing subpattern count = 3
310First code unit = 'x'
311Subject length lower bound = 3
312    xab123
313 0: xab
314 1: ab
315    xfghi
316Failed: error -52: nested recursion at the same subject position
317
318/(?!\w)(?R)/
319    abcd
320Failed: error -52: nested recursion at the same subject position
321    =abc
322Failed: error -52: nested recursion at the same subject position
323
324/(?=\w)(?R)/
325    =abc
326Failed: error -52: nested recursion at the same subject position
327    abcd
328Failed: error -52: nested recursion at the same subject position
329
330/(?<!\w)(?R)/
331    abcd
332Failed: error -52: nested recursion at the same subject position
333
334/(?<=\w)(?R)/
335    abcd
336Failed: error -52: nested recursion at the same subject position
337
338/(a+|(?R)b)/
339    aaa
340 0: aaa
341 1: aaa
342    bbb
343Failed: error -52: nested recursion at the same subject position
344
345/[^\xff]((?1))/BI
346------------------------------------------------------------------
347        Bra
348        [^\x{ff}]
349        CBra 1
350        Recurse
351        Ket
352        Ket
353        End
354------------------------------------------------------------------
355Capturing subpattern count = 1
356Subject length lower bound = 1
357    abcd
358Failed: error -52: nested recursion at the same subject position
359
360# These tests don't behave the same with JIT
361
362/\w+(?C1)/BI,no_auto_possess
363------------------------------------------------------------------
364        Bra
365        \w+
366        Callout 1 8 0
367        Ket
368        End
369------------------------------------------------------------------
370Capturing subpattern count = 0
371Options: no_auto_possess
372Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
373  Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
374Subject length lower bound = 1
375    abc\=callout_fail=1
376--->abc
377  1 ^  ^    End of pattern
378  1 ^ ^     End of pattern
379  1 ^^      End of pattern
380  1  ^ ^    End of pattern
381  1  ^^     End of pattern
382  1   ^^    End of pattern
383No match
384
385/(*NO_AUTO_POSSESS)\w+(?C1)/BI
386------------------------------------------------------------------
387        Bra
388        \w+
389        Callout 1 26 0
390        Ket
391        End
392------------------------------------------------------------------
393Capturing subpattern count = 0
394Compile options: <none>
395Overall options: no_auto_possess
396Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
397  Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
398Subject length lower bound = 1
399    abc\=callout_fail=1
400--->abc
401  1 ^  ^    End of pattern
402  1 ^ ^     End of pattern
403  1 ^^      End of pattern
404  1  ^ ^    End of pattern
405  1  ^^     End of pattern
406  1   ^^    End of pattern
407No match
408
409# This test breaks the JIT stack limit
410
411/(|]+){2,2452}/
412    (|]+){2,2452}
413 0:
414 1:
415
416/(*LIMIT_HEAP=21)\[(a)]{60}/expand
417    \[a]{60}
418Failed: error -63: heap limit exceeded
419
420# End of testinput15
421