testinput15 3.9 KB

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