From: Guido van Rossum Date: Fri, 25 Apr 2003 01:40:11 +0000 (+0000) Subject: Fix test_limitations(). The match there is *expected* to raise X-Git-Tag: v2.3c1~1001 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=46144be02cbd6b8d6626c2e5048339364705c454;p=thirdparty%2FPython%2Fcpython.git Fix test_limitations(). The match there is *expected* to raise RuntimeError. --- diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index d116c6d67106..51ab02df6182 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -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