[Python-checkins] python/dist/src/Lib/test test_b2.py,1.34,1.35
rhettinger@users.sourceforge.net
rhettinger@users.sourceforge.net
Wed, 05 Jun 2002 16:12:47 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv2645/Lib/test
Modified Files:
test_b2.py
Log Message:
Skip Montanaro's patch, SF 559833, exposing xrange type in builtins.
Also, added more regression tests to cover the new type and test its
conformity with range().
Index: test_b2.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_b2.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** test_b2.py 12 May 2002 07:19:37 -0000 1.34
--- test_b2.py 5 Jun 2002 23:12:44 -0000 1.35
***************
*** 296,299 ****
--- 296,304 ----
if tuple(xrange(0,10,2)) != tuple(range(0,10,2)):
raise TestFailed, 'xrange(0,10,2)'
+ x = xrange(10); a = iter(x); b = iter(a) # test clearing of SF bug 564601
+ if id(x) == id(a): raise TestFailed, "xrange doesn't have a separate iterator"
+ if id(a) != id(b): raise TestFailed, "xrange iterator not behaving like range"
+ if type(x) != xrange: raise TestFailed, "xrange type not exposed" # SF 559833
+ if list(x) != list(x): raise TestFailed, "xrange should be restartable"
print 'zip'