mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
Fix test_limitations(). The match there is *expected* to raise
RuntimeError.
This commit is contained in:
parent
f8d0c075b2
commit
46144be02c
1 changed files with 6 additions and 1 deletions
|
|
@ -179,7 +179,12 @@ class ReTests(unittest.TestCase):
|
|||
def test_limitations(self):
|
||||
# Try nasty case that overflows the straightforward recursive
|
||||
# implementation of repeated groups.
|
||||
self.assertEqual(re.match('(x)*', 50000*'x').span(), (0, 50000))
|
||||
try:
|
||||
re.match('(x)*', 50000*'x')
|
||||
except RuntimeError, v:
|
||||
self.assertEqual(str(v), "maximum recursion limit exceeded")
|
||||
else:
|
||||
self.fail("re.match('(x)*', 50000*'x') should have failed")
|
||||
|
||||
def run_re_tests():
|
||||
from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue