diff options
| author | Raymond Hettinger <python@rcn.com> | 2013-10-06 00:20:18 (GMT) |
|---|---|---|
| committer | Raymond Hettinger <python@rcn.com> | 2013-10-06 00:20:18 (GMT) |
| commit | 3472fafe745954d1882658f21e54865662f62788 (patch) | |
| tree | b2d4640ab49a69f6ecbc0a3de565da5be1c3fa3c /Lib/test/test_bytes.py | |
| parent | f77cdbeff71b24debf32c9c6605148ae002be5e2 (diff) | |
| parent | 9259c21a63ea5c342936a18317d455f747248b2f (diff) | |
| download | cpython-3472fafe745954d1882658f21e54865662f62788.zip cpython-3472fafe745954d1882658f21e54865662f62788.tar.gz cpython-3472fafe745954d1882658f21e54865662f62788.tar.bz2 | |
merge
Diffstat (limited to 'Lib/test/test_bytes.py')
| -rw-r--r-- | Lib/test/test_bytes.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index f12f911..847c7a6 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -909,6 +909,15 @@ class ByteArrayTest(BaseBytesTest, unittest.TestCase): with self.assertRaises(ValueError): b[3:4] = elem + def test_setslice_extend(self): + # Exercise the resizing logic (see issue #19087) + b = bytearray(range(100)) + self.assertEqual(list(b), list(range(100))) + del b[:10] + self.assertEqual(list(b), list(range(10, 100))) + b.extend(range(100, 110)) + self.assertEqual(list(b), list(range(10, 110))) + def test_extended_set_del_slice(self): indices = (0, None, 1, 3, 19, 300, 1<<333, -1, -2, -31, -300) for start in indices: |
