summaryrefslogtreecommitdiff
path: root/tests/micropython/const_error.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-04-06 12:19:03 +1000
committerDamien George <damien.p.george@gmail.com>2020-04-09 16:02:39 +1000
commit4914731e5831b289f7933e53cf34bdc79c7b7403 (patch)
tree6c4177f4771547e4e94eaa95b9bfca3922378ace /tests/micropython/const_error.py
parenta5f2ae10fe2daf0acfb4b68090938206857c0582 (diff)
py/parse: Remove unnecessary check in const folding for ** operator.
In this part of the code there is no way to get the ** operator, so no need to check for it. This commit also adds tests for this, and other related, invalid const operations.
Diffstat (limited to 'tests/micropython/const_error.py')
-rw-r--r--tests/micropython/const_error.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/micropython/const_error.py b/tests/micropython/const_error.py
index 311cfb4d5..395fe0f77 100644
--- a/tests/micropython/const_error.py
+++ b/tests/micropython/const_error.py
@@ -15,3 +15,12 @@ test_syntax("a = const(x)")
# redefined constant
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 % 0)")
+test_syntax("A = const(1 // 0)")