summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bytes.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_bytes.py')
-rw-r--r--Lib/test/test_bytes.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index 206dde9..4b346d6 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -832,6 +832,11 @@ class AssortedBytesTest(unittest.TestCase):
def test_rsplit_bytearray(self):
self.assertEqual(b'a b'.rsplit(memoryview(b' ')), [b'a', b'b'])
+ def test_return_self(self):
+ # bytearray.replace must always return a new bytearray
+ b = bytearray()
+ self.failIf(b.replace(b'', b'') is b)
+
# Optimizations:
# __iter__? (optimization)
# __reversed__? (optimization)