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

Fredrik Lundh effbot@users.sourceforge.net
Tue, 18 Sep 2001 13:55:27 -0700


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

Modified Files:
	test_sre.py 
Log Message:


fixed #449964: sre.sub raises an exception if the template contains a
\g<x> group reference followed by a character escape

(also restructured a few things on the way to fixing #449000)


Index: test_sre.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sre.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** test_sre.py	2001/09/18 18:47:09	1.28
--- test_sre.py	2001/09/18 20:55:24	1.29
***************
*** 105,108 ****
--- 105,111 ----
  test(r"""sre.sub(r'(?P<unk>x)', '\g<1>\g<1>', 'xx')""", 'xxxx')
  
+ # bug 449964: fails for group followed by other escape
+ test(r"""sre.sub(r'(?P<unk>x)', '\g<1>\g<1>\\b', 'xx')""", 'xx\bxx\b')
+ 
  test(r"""sre.sub(r'a', r'\t\n\v\r\f\a\b\B\Z\a\A\w\W\s\S\d\D', 'a')""", '\t\n\v\r\f\a\b\\B\\Z\a\\A\\w\\W\\s\\S\\d\\D')
  test(r"""sre.sub(r'a', '\t\n\v\r\f\a', 'a')""", '\t\n\v\r\f\a')