• Home
  • 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
10  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits
11  aaaaaaaaaaaaaz\=find_limits
12
13!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I
14   /* this is a C style comment */\=find_limits
15
16/^(?>a)++/
17    aa\=find_limits
18    aaaaaaaaa\=find_limits
19
20/(a)(?1)++/
21    aa\=find_limits
22    aaaaaaaaa\=find_limits
23
24/a(?:.)*?a/ims
25    abbbbbbbbbbbbbbbbbbbbba\=find_limits
26
27/a(?:.(*THEN))*?a/ims
28    abbbbbbbbbbbbbbbbbbbbba\=find_limits
29
30/a(?:.(*THEN:ABC))*?a/ims
31    abbbbbbbbbbbbbbbbbbbbba\=find_limits
32
33/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
34     aabbccddee\=find_limits
35
36/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
37     aabbccddee\=find_limits
38
39/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
40     aabbccddee\=find_limits
41
42/(*LIMIT_MATCH=12bc)abc/
43
44/(*LIMIT_MATCH=4294967290)abc/
45
46/(*LIMIT_DEPTH=4294967280)abc/I
47
48/(a+)*zz/
49\= Expect no match
50    aaaaaaaaaaaaaz
51\= Expect limit exceeded
52    aaaaaaaaaaaaaz\=match_limit=3000
53
54/(a+)*zz/
55\= Expect limit exceeded
56    aaaaaaaaaaaaaz\=depth_limit=10
57
58/(*LIMIT_MATCH=3000)(a+)*zz/I
59\= Expect limit exceeded
60    aaaaaaaaaaaaaz
61\= Expect limit exceeded
62    aaaaaaaaaaaaaz\=match_limit=60000
63
64/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
65\= Expect limit exceeded
66    aaaaaaaaaaaaaz
67
68/(*LIMIT_MATCH=60000)(a+)*zz/I
69\= Expect no match
70    aaaaaaaaaaaaaz
71\= Expect limit exceeded
72    aaaaaaaaaaaaaz\=match_limit=3000
73
74/(*LIMIT_DEPTH=10)(a+)*zz/I
75\= Expect limit exceeded
76    aaaaaaaaaaaaaz
77\= Expect limit exceeded
78    aaaaaaaaaaaaaz\=depth_limit=1000
79
80/(*LIMIT_DEPTH=10)(*LIMIT_DEPTH=1000)(a+)*zz/I
81\= Expect no match
82    aaaaaaaaaaaaaz
83
84/(*LIMIT_DEPTH=1000)(a+)*zz/I
85\= Expect no match
86    aaaaaaaaaaaaaz
87\= Expect limit exceeded
88    aaaaaaaaaaaaaz\=depth_limit=10
89
90# These three have infinitely nested recursions.
91
92/((?2))((?1))/
93    abc
94
95/((?(R2)a+|(?1)b))()/
96    aaaabcde
97
98/(?(R)a*(?1)|((?R))b)/
99    aaaabcde
100
101# The allusedtext modifier does not work with JIT, which does not maintain
102# the leftchar/rightchar data.
103
104/abc(?=xyz)/allusedtext
105    abcxyzpqr
106    abcxyzpqr\=aftertext
107
108/(?<=pqr)abc(?=xyz)/allusedtext
109    xyzpqrabcxyzpqr
110    xyzpqrabcxyzpqr\=aftertext
111
112/a\b/
113    a.\=allusedtext
114    a\=allusedtext
115
116/abc\Kxyz/
117    abcxyz\=allusedtext
118
119/abc(?=xyz(*ACCEPT))/
120    abcxyz\=allusedtext
121
122/abc(?=abcde)(?=ab)/allusedtext
123    abcabcdefg
124
125#subject allusedtext
126
127/(?<=abc)123/
128    xyzabc123pqr
129    xyzabc12\=ps
130    xyzabc12\=ph
131
132/\babc\b/
133    +++abc+++
134    +++ab\=ps
135    +++ab\=ph
136
137/(?<=abc)def/
138    abc\=ph
139
140/(?<=123)(*MARK:xx)abc/mark
141    xxxx123a\=ph
142    xxxx123a\=ps
143
144/(?<=(?<=a)b)c.*/I
145    abc\=ph
146\= Expect no match
147    xbc\=ph
148
149/(?<=ab)c.*/I
150    abc\=ph
151\= Expect no match
152    xbc\=ph
153
154/abc(?<=bc)def/
155    xxxabcd\=ph
156
157/(?<=ab)cdef/
158    xxabcd\=ph
159
160/(?<=(?<=(?<=a)b)c)./I
161    123abcXYZ
162
163/(?<=ab(cd(?<=...)))./I
164    abcdX
165
166/(?<=ab((?<=...)cd))./I
167    ZabcdX
168
169/(?<=((?<=(?<=ab).))(?1)(?1))./I
170    abxZ
171
172#subject
173# -------------------------------------------------------------------
174
175# These tests provoke recursion loops, which give a different error message
176# when JIT is used.
177
178/(?R)/I
179    abcd
180
181/(a|(?R))/I
182    abcd
183    defg
184
185/(ab|(bc|(de|(?R))))/I
186    abcd
187    fghi
188
189/(ab|(bc|(de|(?1))))/I
190    abcd
191    fghi
192
193/x(ab|(bc|(de|(?1)x)x)x)/I
194    xab123
195    xfghi
196
197/(?!\w)(?R)/
198    abcd
199    =abc
200
201/(?=\w)(?R)/
202    =abc
203    abcd
204
205/(?<!\w)(?R)/
206    abcd
207
208/(?<=\w)(?R)/
209    abcd
210
211/(a+|(?R)b)/
212    aaa
213    bbb
214
215/[^\xff]((?1))/BI
216    abcd
217
218# These tests don't behave the same with JIT
219
220/\w+(?C1)/BI,no_auto_possess
221    abc\=callout_fail=1
222
223/(*NO_AUTO_POSSESS)\w+(?C1)/BI
224    abc\=callout_fail=1
225
226# This test breaks the JIT stack limit
227
228/(|]+){2,2452}/
229    (|]+){2,2452}
230
231/(*LIMIT_HEAP=21)\[(a)]{60}/expand
232    \[a]{60}
233
234/b(?<!ax)(?!cx)/allusedtext
235    abc
236    abcz
237
238# End of testinput15
239