summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/array_add.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-11-30 00:00:55 +0000
committerDamien George <damien.p.george@gmail.com>2014-11-30 00:00:55 +0000
commitb2e731177e96e55f202811968725b128ca13d861 (patch)
tree847b6cd4b524c2c14e6fb1ad24350017a15cecd1 /tests/basics/array_add.py
parent19fb1b4dd7173ad2cf4b2bb1b0f0c06498499bd2 (diff)
downloadmicropython-b2e731177e96e55f202811968725b128ca13d861.tar.gz
micropython-b2e731177e96e55f202811968725b128ca13d861.zip
py: Implement +, += and .extend for bytearray and array objs.
Addresses issue #994.
Diffstat (limited to 'tests/basics/array_add.py')
-rw-r--r--tests/basics/array_add.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/basics/array_add.py b/tests/basics/array_add.py
new file mode 100644
index 0000000000..1dba8a3bc5
--- /dev/null
+++ b/tests/basics/array_add.py
@@ -0,0 +1,12 @@
+# test array + array
+import array
+
+a1 = array.array('I', [1])
+a2 = array.array('I', [2])
+print(a1 + a2)
+
+a1 += array.array('I', [3, 4])
+print(a1)
+
+a1.extend(array.array('I', [5]))
+print(a1)