diff options
author | Damien George <damien.p.george@gmail.com> | 2015-09-07 17:08:49 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-09-07 17:08:49 +0100 |
commit | 081f9325f522b25e2f6b4266dca3f2d2dd1c69ac (patch) | |
tree | 5eb06ad4c046aa47c5d9939435c4a74649e94066 /tests/misc/non_compliant_lexer.py | |
parent | a7ffa972f30052368ccd304787bbe523d212fc57 (diff) | |
download | micropython-081f9325f522b25e2f6b4266dca3f2d2dd1c69ac.tar.gz micropython-081f9325f522b25e2f6b4266dca3f2d2dd1c69ac.zip |
py/lexer: Raise NotImplError for unicode name escape, instead of assert.
Diffstat (limited to 'tests/misc/non_compliant_lexer.py')
-rw-r--r-- | tests/misc/non_compliant_lexer.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/misc/non_compliant_lexer.py b/tests/misc/non_compliant_lexer.py index e0618efbbe..7e50d2836c 100644 --- a/tests/misc/non_compliant_lexer.py +++ b/tests/misc/non_compliant_lexer.py @@ -1,5 +1,14 @@ # lexer tests for things that are not implemented, or have non-compliant behaviour +def test(code): + try: + exec(code) + print('no Error') + except SyntaxError: + print('SyntaxError') + except NotImplementedError: + print('NotImplementedError') + # uPy requires spaces between literal numbers and keywords, CPy doesn't try: eval('1and 0') @@ -17,3 +26,6 @@ try: eval('1if 0else 0') except SyntaxError: print('SyntaxError') + +# unicode name escapes are not implemented +test('"\\N{LATIN SMALL LETTER A}"') |