summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bytes.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-16 19:15:57 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-16 19:15:57 (GMT)
commitc742dff16a8dd6979a7857948f63f99f391bb369 (patch)
treece6e437720348a246ad3ee677d1f18e980b86198 /Lib/test/test_bytes.py
parent3079bbebac4e455bec8e3f2e983daf63503af196 (diff)
downloadcpython-c742dff16a8dd6979a7857948f63f99f391bb369.zip
cpython-c742dff16a8dd6979a7857948f63f99f391bb369.tar.gz
cpython-c742dff16a8dd6979a7857948f63f99f391bb369.tar.bz2
Issue #27039: Fixed bytearray.remove() for values greater than 127.
Patch by Joe Jevnik.
Diffstat (limited to 'Lib/test/test_bytes.py')
-rw-r--r--Lib/test/test_bytes.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index 8e33b52..4a70b33 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -723,6 +723,13 @@ class ByteArrayTest(BaseBytesTest):
b.remove(Indexable(ord('e')))
self.assertEqual(b, b'')
+ # test values outside of the ascii range: (0, 127)
+ c = bytearray([126, 127, 128, 129])
+ c.remove(127)
+ self.assertEqual(c, bytearray([126, 128, 129]))
+ c.remove(129)
+ self.assertEqual(c, bytearray([126, 128]))
+
def test_pop(self):
b = bytearray(b'world')
self.assertEqual(b.pop(), ord('d'))