github的一些开源项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

253 lines
4.5 KiB

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