diff --git a/tests/misc/non_compliant_lexer.py b/tests/misc/non_compliant_lexer.py new file mode 100644 index 0000000000..e0618efbbe --- /dev/null +++ b/tests/misc/non_compliant_lexer.py @@ -0,0 +1,19 @@ +# lexer tests for things that are not implemented, or have non-compliant behaviour + +# uPy requires spaces between literal numbers and keywords, CPy doesn't +try: + eval('1and 0') +except SyntaxError: + print('SyntaxError') +try: + eval('1or 0') +except SyntaxError: + print('SyntaxError') +try: + eval('1if 1else 0') +except SyntaxError: + print('SyntaxError') +try: + eval('1if 0else 0') +except SyntaxError: + print('SyntaxError') diff --git a/tests/misc/non_compliant_lexer.py.exp b/tests/misc/non_compliant_lexer.py.exp new file mode 100644 index 0000000000..18b00cc767 --- /dev/null +++ b/tests/misc/non_compliant_lexer.py.exp @@ -0,0 +1,4 @@ +SyntaxError +SyntaxError +SyntaxError +SyntaxError