[Python-checkins] CVS: python/dist/src/Lib/test test_sre.py,1.5,1.6

Fredrik Lundh python-dev@python.org
Thu, 3 Aug 2000 09:29:53 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv12492/Lib/test

Modified Files:
	test_sre.py 
Log Message:


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


Index: test_sre.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sre.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** test_sre.py	2000/08/01 13:16:55	1.5
--- test_sre.py	2000/08/03 16:29:50	1.6
***************
*** 265,268 ****
--- 265,278 ----
          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 *