-- 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
This commit is contained in:
Fredrik Lundh 2000-08-03 16:29:50 +00:00
parent 16b1ad9c7d
commit 96ab46529b
4 changed files with 183 additions and 158 deletions

View file

@ -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: