]> granicus.if.org Git - python/commitdiff
Fix test_limitations(). The match there is *expected* to raise
authorGuido van Rossum <guido@python.org>
Fri, 25 Apr 2003 01:40:11 +0000 (01:40 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 25 Apr 2003 01:40:11 +0000 (01:40 +0000)
RuntimeError.

Lib/test/test_re.py

index d116c6d67106ca9c15fe7b3de011b356545affd7..51ab02df61821adf9a7e9aed62bf43dcee1b427b 100644 (file)
@@ -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