summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--tests/micropython/const_error.py6
-rw-r--r--tests/micropython/const_error.py.exp1
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/micropython/const_error.py b/tests/micropython/const_error.py
new file mode 100644
index 0000000000..fa7deaaf31
--- /dev/null
+++ b/tests/micropython/const_error.py
@@ -0,0 +1,6 @@
+# make sure syntax error works corrects for bad const definition
+
+try:
+ exec("a = const(x)")
+except SyntaxError:
+ print("SyntaxError")
diff --git a/tests/micropython/const_error.py.exp b/tests/micropython/const_error.py.exp
new file mode 100644
index 0000000000..8729fc4343
--- /dev/null
+++ b/tests/micropython/const_error.py.exp
@@ -0,0 +1 @@
+SyntaxError