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

Fredrik Lundh effbot@users.sourceforge.net
Tue, 18 Sep 2001 11:47:11 -0700


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

Modified Files:
	test_sre.py 
Log Message:


an SRE bugfix a day keeps Guido away...

#462270: sub-tle difference between pre.sub and sre.sub.  PRE ignored
an empty match at the previous location, SRE didn't.

also synced with Secret Labs "sreopen" codebase.

Index: test_sre.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sre.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** test_sre.py	2001/08/17 18:39:24	1.27
--- test_sre.py	2001/09/18 18:47:09	1.28
***************
*** 124,127 ****
--- 124,131 ----
  test(r"""sre.sub('\r\n', '\n', 'abc\r\ndef\r\n')""", 'abc\ndef\n')
  
+ # Test for empty sub() behaviour, see SF bug #462270
+ test(r"""sre.sub('x*', '-', 'abxd')""", '-a-b-d-')
+ test(r"""sre.sub('x+', '-', 'abxd')""", 'ab-d')
+ 
  if verbose:
      print 'Running tests on symbolic references'