diff options
author | Guido van Rossum <guido@python.org> | 1998-08-12 02:38:11 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-08-12 02:38:11 (GMT) |
commit | e03c05059534b4783c5631517cb16f79531358e8 (patch) | |
tree | 82285bf56d90ac5c062f328516a959dd416b8e45 /Lib/dos-8x3/test_arr.py | |
parent | 887d072cc04be23e6758257b326499bd1572b929 (diff) | |
download | cpython-e03c05059534b4783c5631517cb16f79531358e8.zip cpython-e03c05059534b4783c5631517cb16f79531358e8.tar.gz cpython-e03c05059534b4783c5631517cb16f79531358e8.tar.bz2 |
The usual.
Diffstat (limited to 'Lib/dos-8x3/test_arr.py')
-rw-r--r-- | Lib/dos-8x3/test_arr.py | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/Lib/dos-8x3/test_arr.py b/Lib/dos-8x3/test_arr.py index 6a0d17c..1e0f1be 100644 --- a/Lib/dos-8x3/test_arr.py +++ b/Lib/dos-8x3/test_arr.py @@ -3,7 +3,7 @@ Roger E. Masse """ import array -from test_support import verbose, TESTFN, unlink +from test_support import verbose, TESTFN, unlink, TestFailed def main(): @@ -54,6 +54,33 @@ def testtype(type, example): print 'array of %s converted to a string: ' \ % a.typecode, `a.tostring()` + if type == 'c': + a = array.array(type, "abcde") + a[:-1] = a + if a != array.array(type, "abcdee"): + raise TestFailed, "array(%s) self-slice-assign (head)" % `type` + a = array.array(type, "abcde") + a[1:] = a + if a != array.array(type, "aabcde"): + raise TestFailed, "array(%s) self-slice-assign (tail)" % `type` + a = array.array(type, "abcde") + a[1:-1] = a + if a != array.array(type, "aabcdee"): + raise TestFailed, "array(%s) self-slice-assign (cntr)" % `type` + else: + a = array.array(type, [1, 2, 3, 4, 5]) + a[:-1] = a + if a != array.array(type, [1, 2, 3, 4, 5, 5]): + raise TestFailed, "array(%s) self-slice-assign (head)" % `type` + a = array.array(type, [1, 2, 3, 4, 5]) + a[1:] = a + if a != array.array(type, [1, 1, 2, 3, 4, 5]): + raise TestFailed, "array(%s) self-slice-assign (tail)" % `type` + a = array.array(type, [1, 2, 3, 4, 5]) + a[1:-1] = a + if a != array.array(type, [1, 1, 2, 3, 4, 5, 5]): + raise TestFailed, "array(%s) self-slice-assign (cntr)" % `type` + main() |