summaryrefslogtreecommitdiff
path: root/tests/cpydiff/module_array_constructor.py
diff options
context:
space:
mode:
authorZoltán Vörös <zvoros@gmail.com>2021-06-12 15:09:24 +0200
committerDamien George <damien@micropython.org>2021-06-13 10:30:14 +1000
commitc4ed17ff345ee59f284a2f6d1ec18034eeb311a9 (patch)
treedf9319c68a90fa4eedb72023d0f57f36f7f7ce10 /tests/cpydiff/module_array_constructor.py
parent3ab8806c0d2fe77e9785216563b419cfadff71b0 (diff)
tests/cpydiff: Add test for array constructor with overflowing value.
Diffstat (limited to 'tests/cpydiff/module_array_constructor.py')
-rw-r--r--tests/cpydiff/module_array_constructor.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/cpydiff/module_array_constructor.py b/tests/cpydiff/module_array_constructor.py
new file mode 100644
index 000000000..08cf2ef2d
--- /dev/null
+++ b/tests/cpydiff/module_array_constructor.py
@@ -0,0 +1,10 @@
+"""
+categories: Modules,array
+description: Overflow checking is not implemented
+cause: MicroPython implements implicit truncation in order to reduce code size and execution time
+workaround: If CPython compatibility is needed then mask the value explicitly
+"""
+import array
+
+a = array.array("b", [257])
+print(a)