Kaydet (Commit) 015415ed authored tarafından Fredrik Lundh's avatar Fredrik Lundh

SRE 2.1b2: increase the chances that the sre test works on other

machines...
üst 816e149c
test_sre
sre.match(r'(x)*?y', 50000*'x'+'y').span() FAILED
Traceback (most recent call last):
File "../lib/test\test_sre.py", line 18, in test
r = eval(expression)
File "<string>", line 0, in ?
File "c:\pythonware\py21\python-2.1\lib\sre.py", line 52, in match
return _compile(pattern, flags).match(string)
RuntimeError: maximum recursion limit exceeded
......@@ -243,12 +243,9 @@ if verbose:
# Try nasty case that overflows the straightforward recursive
# implementation of repeated groups.
test(r"""sre.match(r'(x)*', 50000*'x').span()""",
(0, 50000), RuntimeError)
test(r"""sre.match(r'(x)*y', 50000*'x'+'y').span()""",
(0, 50001), RuntimeError)
test(r"""sre.match(r'(x)*?y', 50000*'x'+'y').span()""",
(0, 50001)) # this works in 2.1
test("sre.match('(x)*', 50000*'x').span()", (0, 50000), RuntimeError)
test("sre.match(r'(x)*y', 50000*'x'+'y').span()", (0, 50001), RuntimeError)
test("sre.match(r'(x)*?y', 50000*'x'+'y').span()", (0, 50001), RuntimeError)
from re_tests import *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment