From 86c7507233929366ff17c9666200a33123491a8e Mon Sep 17 00:00:00 2001 From: Rami Ali Date: Tue, 7 Feb 2017 15:55:37 +1100 Subject: tests/cpydiff: Add initial set of tests for uPy-CPython differences. These tests are intended to fail, as they provide a programatic record of differences between uPy and CPython. They also contain a special comment at the start of the file which has meta-data describing the difference, including known causes and known workarounds. --- tests/cpydiff/syntax_spaces.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/cpydiff/syntax_spaces.py (limited to 'tests/cpydiff/syntax_spaces.py') diff --git a/tests/cpydiff/syntax_spaces.py b/tests/cpydiff/syntax_spaces.py new file mode 100644 index 0000000000..8578a51e28 --- /dev/null +++ b/tests/cpydiff/syntax_spaces.py @@ -0,0 +1,18 @@ +""" +categories: Syntax,Spaces +description: uPy requires spaces between literal numbers and keywords, CPy doesn't +cause: Unknown +workaround: Unknown +""" +try: + print(eval('1and 0')) +except SyntaxError: + print('Should have worked') +try: + print(eval('1or 0')) +except SyntaxError: + print('Should have worked') +try: + print(eval('1if 1else 0')) +except SyntaxError: + print('Should have worked') -- cgit v1.2.3