From c4ed17ff345ee59f284a2f6d1ec18034eeb311a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20V=C3=B6r=C3=B6s?= Date: Sat, 12 Jun 2021 15:09:24 +0200 Subject: [PATCH] tests/cpydiff: Add test for array constructor with overflowing value. --- tests/cpydiff/module_array_constructor.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/cpydiff/module_array_constructor.py diff --git a/tests/cpydiff/module_array_constructor.py b/tests/cpydiff/module_array_constructor.py new file mode 100644 index 0000000000..08cf2ef2d1 --- /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)