Added the unicode/bytes literal escaping issues.

This commit is contained in:
Dave Halter
2017-08-02 10:17:15 +02:00
parent d6c624bd34
commit 3ccbf4326c
4 changed files with 49 additions and 3 deletions

View File

@@ -95,6 +95,16 @@ FAILING_EXAMPLES = [
'(x for 1 in y)',
'{x for 1 in y}',
'{x:x for 1 in y}',
# Unicode/Bytes issues.
r'u"\x"',
r'u"\"',
r'u"\u"',
r'u"""\U"""',
r'u"\Uffffffff"',
r"u'''\N{}'''",
r"u'\N{foo}'",
r'b"\x"',
r'b"\"',
# SyntaxErrors from Python/symtable.c
'def f(x, x): pass',
@@ -304,6 +314,10 @@ def _get_actual_exception(code):
if sys.version_info[:2] == (2, 6) and wanted == 'SyntaxError: unexpected EOF while parsing':
wanted = 'SyntaxError: invalid syntax'
if wanted == 'SyntaxError: EOL while scanning string literal':
# TODO This is not what we want in the future. Remove this.
wanted = 'SyntaxError: invalid syntax'
if wanted == 'SyntaxError: non-keyword arg after keyword arg':
# The python 3.5+ way, a bit nicer.
wanted = 'SyntaxError: positional argument follows keyword argument'