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

Fredrik Lundh effbot@users.sourceforge.net
Thu, 18 Oct 2001 12:30:18 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv20834/Lib/test

Modified Files:
	test_sre.py 
Log Message:


SRE bug #441409:
    compile should raise error for non-strings
SRE bug #432570, 448951:
    reset group after failed match

also bumped version number to 2.2.0

Index: test_sre.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sre.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** test_sre.py	2001/09/18 20:55:24	1.29
--- test_sre.py	2001/10/18 19:30:16	1.30
***************
*** 205,208 ****
--- 205,214 ----
  test(r"""pat.match('ac').group(1, 'b2', 3)""", ('a', None, 'c'))
  
+ # bug 448951 (similar to 429357, but with single char match)
+ # (Also test greedy matches.)
+ for op in '','?','*':
+     test(r"""sre.match(r'((.%s):)?z', 'z').groups()"""%op, (None, None))
+     test(r"""sre.match(r'((.%s):)?z', 'a:z').groups()"""%op, ('a:', 'a'))
+ 
  if verbose:
      print "Running tests on sre.escape"