summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-03-01 12:06:24 +0000
committerDamien George <damien.p.george@gmail.com>2015-03-01 12:06:24 +0000
commit47538cc880e3699fcef3f8a9ff4c8c76fa455795 (patch)
tree4427679dd3d8a933a383a1aa50bf222622d8844a
parent62a3a287d9aca9a8552671257c5b989c32a97d6f (diff)
downloadmicropython-47538cc880e3699fcef3f8a9ff4c8c76fa455795.tar.gz
micropython-47538cc880e3699fcef3f8a9ff4c8c76fa455795.zip
tests: Add test for micropython const feature when it has a SyntaxError.
-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