From a7ffa972f30052368ccd304787bbe523d212fc57 Mon Sep 17 00:00:00 2001
From: Damien George <damien.p.george@gmail.com>
Date: Mon, 7 Sep 2015 16:59:55 +0100
Subject: [PATCH] tests: Add tests for non-compliant behaviour of lexer.

---
 tests/misc/non_compliant_lexer.py     | 19 +++++++++++++++++++
 tests/misc/non_compliant_lexer.py.exp |  4 ++++
 2 files changed, 23 insertions(+)
 create mode 100644 tests/misc/non_compliant_lexer.py
 create mode 100644 tests/misc/non_compliant_lexer.py.exp

diff --git a/tests/misc/non_compliant_lexer.py b/tests/misc/non_compliant_lexer.py
new file mode 100644
index 000000000..e0618efbb
--- /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 000000000..18b00cc76
--- /dev/null
+++ b/tests/misc/non_compliant_lexer.py.exp
@@ -0,0 +1,4 @@
+SyntaxError
+SyntaxError
+SyntaxError
+SyntaxError
-- 
GitLab