summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2000-08-03 16:29:50 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2000-08-03 16:29:50 (GMT)
commit96ab46529b3329da58a2783ddb85b227de553f53 (patch)
tree622719ff8282523830d27ce834bc452e5cf4e1c3 /Lib
parent16b1ad9c7d431975353c06ad952237281e743b39 (diff)
downloadcpython-96ab46529b3329da58a2783ddb85b227de553f53.zip
cpython-96ab46529b3329da58a2783ddb85b227de553f53.tar.gz
cpython-96ab46529b3329da58a2783ddb85b227de553f53.tar.bz2
-- added recursion limit (currently ~10,000 levels)
-- improved error messages -- factored out SRE_COUNT; the same code is used by SRE_OP_REPEAT_ONE_TEMPLATE -- minor cleanups
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/output/test_sre1
-rw-r--r--Lib/test/test_sre.py10
2 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/output/test_sre b/Lib/test/output/test_sre
index dbb6e93..64bacc4 100644
--- a/Lib/test/output/test_sre
+++ b/Lib/test/output/test_sre
@@ -1 +1,2 @@
test_sre
+maximum recursion limit exceeded
diff --git a/Lib/test/test_sre.py b/Lib/test/test_sre.py
index 342c33d..2f16d29 100644
--- a/Lib/test/test_sre.py
+++ b/Lib/test/test_sre.py
@@ -264,6 +264,16 @@ for flags in [sre.I, sre.M, sre.X, sre.S, sre.L, sre.T, sre.U]:
except:
print 'Exception raised on flag', flags
+if verbose:
+ print 'Test engine limitations'
+
+# Try nasty case that overflows the straightforward recursive
+# implementation of repeated groups.
+try:
+ assert sre.match('(x)*', 50000*'x').span() == (0, 50000)
+except RuntimeError, v:
+ print v
+
from re_tests import *
if verbose: