tests: Add tests for non-compliant behaviour of lexer.

This commit is contained in:
Damien George 2015-09-07 16:59:55 +01:00
parent 558a016e2c
commit a7ffa972f3
2 changed files with 23 additions and 0 deletions

View 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')

View File

@ -0,0 +1,4 @@
SyntaxError
SyntaxError
SyntaxError
SyntaxError