]> granicus.if.org Git - python/commitdiff
Add nasty test case that overflows the stack with a repeated group
authorAndrew M. Kuchling <amk@amk.ca>
Thu, 3 Aug 2000 02:06:45 +0000 (02:06 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Thu, 3 Aug 2000 02:06:45 +0000 (02:06 +0000)
Lib/test/test_re.py

index c3c70bc4c4ff641933561daba18967d74713826a..46f442d257c37630399afdf0349e4c4b92863903 100644 (file)
@@ -28,6 +28,10 @@ try:
 except:
     raise TestFailed, "re.search"
 
+# Try nasty case that overflows the straightforward recursive
+# implementation of repeated groups.
+assert re.match('(x)*', 50000*'x').span() == (0, 50000)
+
 if verbose:
     print 'Running tests on re.sub'