diff options
Diffstat (limited to 'tests/micropython/decorator_error.py')
| -rw-r--r-- | tests/micropython/decorator_error.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/micropython/decorator_error.py b/tests/micropython/decorator_error.py new file mode 100644 index 000000000..c7da3119f --- /dev/null +++ b/tests/micropython/decorator_error.py @@ -0,0 +1,11 @@ +# test syntax errors for uPy-specific decorators + +def test_syntax(code): + try: + exec(code) + except SyntaxError: + print("SyntaxError") + +# invalid micropython decorators +test_syntax("@micropython.a\ndef f(): pass") +test_syntax("@micropython.a.b\ndef f(): pass") |
