tests: Add tests for non-compliant behaviour of lexer.
This commit is contained in:
parent
558a016e2c
commit
a7ffa972f3
19
tests/misc/non_compliant_lexer.py
Normal file
19
tests/misc/non_compliant_lexer.py
Normal file
@ -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')
|
4
tests/misc/non_compliant_lexer.py.exp
Normal file
4
tests/misc/non_compliant_lexer.py.exp
Normal file
@ -0,0 +1,4 @@
|
||||
SyntaxError
|
||||
SyntaxError
|
||||
SyntaxError
|
||||
SyntaxError
|
Loading…
Reference in New Issue
Block a user