Mailing List Archive

python/dist/src/Lib/test test_types.py,1.28,1.29
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv3075/Lib/test

Modified Files:
test_types.py
Log Message:
Buffer-object repitition and concatenation has worked all along; add a test
to make avoid regression.


Index: test_types.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_types.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** test_types.py 16 Apr 2002 01:38:40 -0000 1.28
--- test_types.py 2 May 2002 04:27:20 -0000 1.29
***************
*** 523,526 ****
--- 523,532 ----
if a == b:
raise TestFailed, 'buffers should not be equal'
+ if str(b) != ('asdf' * 5):
+ raise TestFailed, 'repeated buffer has wrong content'
+ if str(a * 0) != '':
+ raise TestFailed, 'repeated buffer zero times has wrong content'
+ if str(a + buffer('def')) != 'asdfdef':
+ raise TestFailed, 'concatenation of buffers yields wrong content'

try: a[1] = 'g'