[Python-checkins] CVS: python/dist/src/Lib/test test_sre.py,1.8,1.9 re_tests.py,1.17,1.18

Fredrik Lundh python-dev@python.org
Sat, 2 Sep 2000 09:36:59 -0700


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

Modified Files:
	test_sre.py re_tests.py 
Log Message:


return -1 for undefined groups (as implemented in 1.5.2) instead of
None (as documented) from start/end/span.  closes bug #113254


Index: test_sre.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sre.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** test_sre.py	2000/09/02 11:03:34	1.8
--- test_sre.py	2000/09/02 16:36:57	1.9
***************
*** 47,51 ****
      print 'Running tests on character literals'
  
! for i in range(0, 256):
      test(r"""sre.match("\%03o" % i, chr(i)) != None""", 1)
      test(r"""sre.match("\%03o0" % i, chr(i)+"0") != None""", 1)
--- 47,51 ----
      print 'Running tests on character literals'
  
! for i in [0, 8, 16, 32, 64, 127, 128, 255]:
      test(r"""sre.match("\%03o" % i, chr(i)) != None""", 1)
      test(r"""sre.match("\%03o0" % i, chr(i)+"0") != None""", 1)
***************
*** 73,76 ****
--- 73,81 ----
  test(r"""sre.match('x*', 'xxxa').span()""", (0, 3))
  test(r"""sre.match('a+', 'xxx')""", None)
+ 
+ # bug 113254
+ test(r"""sre.match('(a)|(b)', 'b').start(1)""", -1)
+ test(r"""sre.match('(a)|(b)', 'b').end(1)""", -1)
+ test(r"""sre.match('(a)|(b)', 'b').span(1)""", (-1, -1))
  
  if verbose:

Index: re_tests.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/re_tests.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18