]> granicus.if.org Git - python/commitdiff
Add test case for r63810.
authorGeorg Brandl <georg@python.org>
Fri, 30 May 2008 12:05:02 +0000 (12:05 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 30 May 2008 12:05:02 +0000 (12:05 +0000)
Lib/test/test_bytes.py

index 206dde935b6ecacc50b255520c02d4a565bc4f0f..4b346d6fee7902afa94d8953d18c0397e36b364e 100644 (file)
@@ -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)