summaryrefslogtreecommitdiff
path: root/tests/micropython/const_error.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-04-07 12:23:08 +1000
committerDamien George <damien.p.george@gmail.com>2020-05-03 16:23:19 +1000
commit4ede70368722f4702320412f393a7c703cdf4276 (patch)
tree30615518e0a6d69c5bdd7e17b71816ee929348c6 /tests/micropython/const_error.py
parent40e92277339697159e9ae120d814b64b6d4bbf04 (diff)
py/parse: Support constant folding of power operator for integers.
Constant expression like "2 ** 3" will now be folded, and the special form "X = const(2 ** 3)" will now compile because the argument to the const is now a constant. Fixes issue #5865.
Diffstat (limited to 'tests/micropython/const_error.py')
-rw-r--r--tests/micropython/const_error.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/micropython/const_error.py b/tests/micropython/const_error.py
index 395fe0f77..d35be530a 100644
--- a/tests/micropython/const_error.py
+++ b/tests/micropython/const_error.py
@@ -19,7 +19,7 @@ test_syntax("A = const(1); A = const(2)")
# these operations are not supported within const
test_syntax("A = const(1 @ 2)")
test_syntax("A = const(1 / 2)")
-test_syntax("A = const(1 ** 2)")
+test_syntax("A = const(1 ** -2)")
test_syntax("A = const(1 << -2)")
test_syntax("A = const(1 >> -2)")
test_syntax("A = const(1 % 0)")