[Python-checkins] python/dist/src/Lib/test test_types.py,1.47,1.48

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Mon, 14 Apr 2003 13:58:41 -0700


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

Modified Files:
	test_types.py 
Log Message:
- list.insert(i, x) now interprets negative i as it would be
  interpreted by slicing, so negative values count from the end of the
  list.  This was the only place where such an interpretation was not
  placed on a list index.


Index: test_types.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_types.py,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** test_types.py	6 Mar 2003 23:54:27 -0000	1.47
--- test_types.py	14 Apr 2003 20:58:03 -0000	1.48
***************
*** 346,349 ****
--- 346,354 ----
  a.insert(2,0)
  if a != [-2,-1,0,0,1,2]: raise TestFailed, 'list insert'
+ b = a[:]
+ b.insert(-2, "foo")
+ b.insert(-200, "left")
+ b.insert(200, "right")
+ if b != ["left",-2,-1,0,0,"foo",1,2,"right"]: raise TestFailed, 'list insert2'
  if a.count(0) != 2: raise TestFailed, ' list count'
  if a.index(0) != 2: raise TestFailed, 'list index'