summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-05-02 04:27:20 (GMT)
committerFred Drake <fdrake@acm.org>2002-05-02 04:27:20 (GMT)
commit485f340d52423bcd46cd9fa396f64b06252e789a (patch)
treef6fd7bc76d1e779fa78350c2e441587ec2eef7c7
parenteb2b8334d5ee1e79f53349a60bfd0c1ec049a197 (diff)
downloadcpython-485f340d52423bcd46cd9fa396f64b06252e789a.zip
cpython-485f340d52423bcd46cd9fa396f64b06252e789a.tar.gz
cpython-485f340d52423bcd46cd9fa396f64b06252e789a.tar.bz2
Buffer-object repitition and concatenation has worked all along; add a test
to make avoid regression.
-rw-r--r--Lib/test/test_types.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py
index fc30e5b..bc13c5f 100644
--- a/Lib/test/test_types.py
+++ b/Lib/test/test_types.py
@@ -522,6 +522,12 @@ hash(a)
b = a * 5
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'
except TypeError: pass