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

Tim Peters python-dev@python.org
Sun, 3 Sep 2000 01:15:22 -0700


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

Modified Files:
	test_sre.py 
Log Message:
Repair failing test_sre.py.
This was a funny one!  The test very subtly relied on 1.5.2's
behavior of treating "\x%" as "\x%", i.e. ignoring that was an
\x escape that didn't make sense.  But /F implemented PEP 223,
which causes 2.0 to raise an exception on the bad escape.
Fixed by merely making the 3 such strings of this kind into
raw strings.


Index: test_sre.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sre.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** test_sre.py	2000/09/02 16:36:57	1.9
--- test_sre.py	2000/09/03 08:15:19	1.10
***************
*** 51,57 ****
      test(r"""sre.match("\%03o0" % i, chr(i)+"0") != None""", 1)
      test(r"""sre.match("\%03o8" % i, chr(i)+"8") != None""", 1)
!     test(r"""sre.match("\x%02x" % i, chr(i)) != None""", 1)
!     test(r"""sre.match("\x%02x0" % i, chr(i)+"0") != None""", 1)
!     test(r"""sre.match("\x%02xz" % i, chr(i)+"z") != None""", 1)
  test(r"""sre.match("\911", "")""", None, sre.error)
  
--- 51,57 ----
      test(r"""sre.match("\%03o0" % i, chr(i)+"0") != None""", 1)
      test(r"""sre.match("\%03o8" % i, chr(i)+"8") != None""", 1)
!     test(r"""sre.match(r"\x%02x" % i, chr(i)) != None""", 1)
!     test(r"""sre.match(r"\x%02x0" % i, chr(i)+"0") != None""", 1)
!     test(r"""sre.match(r"\x%02xz" % i, chr(i)+"z") != None""", 1)
  test(r"""sre.match("\911", "")""", None, sre.error)