summaryrefslogtreecommitdiff
path: root/tests/basics/bytearray_add.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics/bytearray_add.py')
-rw-r--r--tests/basics/bytearray_add.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/basics/bytearray_add.py b/tests/basics/bytearray_add.py
index a7e2b5737..1f30a3b74 100644
--- a/tests/basics/bytearray_add.py
+++ b/tests/basics/bytearray_add.py
@@ -15,4 +15,11 @@ print(b)
# this inplace add tests the code when the buffer doesn't need to be increased
b = bytearray()
-b += b''
+b += b""
+
+# extend a bytearray from itself
+b = bytearray(b"abcdefgh")
+for _ in range(4):
+ c = bytearray(b) # extra allocation, as above
+ b.extend(b)
+print(b)