summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_parser.py')
-rw-r--r--Lib/test/test_parser.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index ddb58b5..dbf6a92 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -443,6 +443,12 @@ class CompileTestCase(unittest.TestCase):
st = parser.suite('1 = 3 + 4')
self.assertRaises(SyntaxError, parser.compilest, st)
+ def test_compile_badunicode(self):
+ st = parser.suite('a = u"\U12345678"')
+ self.assertRaises(SyntaxError, parser.compilest, st)
+ st = parser.suite('a = u"\u1"')
+ self.assertRaises(SyntaxError, parser.compilest, st)
+
def test_main():
test_support.run_unittest(
RoundtripLegalSyntaxTestCase,