[Python-checkins] python/dist/src/Lib/test re_tests.py,1.31,1.32

nnorwitz@users.sourceforge.net nnorwitz@users.sourceforge.net
Wed, 12 Feb 2003 19:01:22 -0800


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

Modified Files:
	re_tests.py 
Log Message:
SF patch #682432, add lookbehind tests


Index: re_tests.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/re_tests.py,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** re_tests.py	6 Nov 2002 14:06:52 -0000	1.31
--- re_tests.py	13 Feb 2003 03:01:18 -0000	1.32
***************
*** 549,552 ****
--- 549,559 ----
      ('^(.+)?B', 'AB', SUCCEED, 'g1', 'A'),
  
+     # lookbehind: split by : but not if it is escaped by -.
+     ('(?<!-):(.*?)(?<!-):', 'a:bc-:de:f', SUCCEED, 'g1', 'bc-:de' ),
+     # escaping with \ as we know it
+     ('(?<!\\\):(.*?)(?<!\\\):', 'a:bc\\:de:f', SUCCEED, 'g1', 'bc\\:de' ),
+     # terminating with ' and escaping with ? as in edifact
+     ("(?<!\\?)'(.*?)(?<!\\?)'", "a'bc?'de'f", SUCCEED, 'g1', "bc?'de" ), 
+ 
      # Comments using the (?#...) syntax