[Python-checkins] python/dist/src/Lib/test test_types.py,1.60,1.61
nascheme at users.sourceforge.net
nascheme at users.sourceforge.net
Fri Sep 24 17:35:18 CEST 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2082/Lib/test
Modified Files:
test_types.py
Log Message:
Add a few more tests for the buffer() object.
Index: test_types.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_types.py,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- test_types.py 31 May 2004 16:29:04 -0000 1.60
+++ test_types.py 24 Sep 2004 15:35:15 -0000 1.61
@@ -245,6 +245,14 @@
raise TestFailed, 'repeated buffer zero times has wrong content'
if str(a + buffer('def')) != 'asdfdef':
raise TestFailed, 'concatenation of buffers yields wrong content'
+if str(buffer(a)) != 'asdf':
+ raise TestFailed, 'composing buffers failed'
+if str(buffer(a, 2)) != 'df':
+ raise TestFailed, 'specifying buffer offset failed'
+if str(buffer(a, 0, 2)) != 'as':
+ raise TestFailed, 'specifying buffer size failed'
+if str(buffer(a, 1, 2)) != 'sd':
+ raise TestFailed, 'specifying buffer offset and size failed'
try: a[1] = 'g'
except TypeError: pass
More information about the Python-checkins
mailing list