summaryrefslogtreecommitdiff
path: root/Lib/test/test_parser.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-07-18 17:19:14 +0000
committerGuido van Rossum <guido@python.org>2007-07-18 17:19:14 +0000
commitb6ac23cd07ce560dcfd41e74e915d6afe4e8a525 (patch)
tree9305b114506e853de2059d7506c0471f30bf051b /Lib/test/test_parser.py
parenta3a4c2f4114fb9d43d80681dea155fd7538c9939 (diff)
downloadcpython-git-b6ac23cd07ce560dcfd41e74e915d6afe4e8a525.tar.gz
SF patch# 1755885 by Kurt Kaiser: show location of Unicode escape errors.
(Slightly tweaked for style and refcounts.)
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 4bd2943b11..fd2861034d 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -474,6 +474,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,