[Python-checkins] python/dist/src/Lib/test test_types.py,1.54,1.55

doerwalter@users.sourceforge.net doerwalter@users.sourceforge.net
Tue, 17 Jun 2003 12:27:41 -0700


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

Modified Files:
	test_types.py 
Log Message:
Use _PyEval_SliceIndex to handle list.index() calls with 
huge start and stop arguments. Add tests.


Index: test_types.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_types.py,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -d -r1.54 -r1.55
*** test_types.py	17 Jun 2003 14:25:14 -0000	1.54
--- test_types.py	17 Jun 2003 19:27:39 -0000	1.55
***************
*** 375,378 ****
--- 375,387 ----
  if a.index(0,3,4) != 3: raise TestFailed, 'list index, stop argument'
  if a.index(0,-3,-2) != 3: raise TestFailed, 'list index, -stop argument'
+ if a.index(0,-4*sys.maxint,4*sys.maxint) != 2:
+     raise TestFailed, 'list index, -maxint, maxint argument'
+ try:
+     a.index(0, 4*sys.maxint,-4*sys.maxint)
+ except ValueError:
+     pass
+ else:
+     raise TestFailed, 'list index, maxint,-maxint argument'
+ 
  try:
      a.index(2,0,-10)