Skip to content

Commit a4a49d7

Browse files
committed
Add syntax error offset tests
1 parent b203743 commit a4a49d7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Lib/test/test_exceptions.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,16 @@ def testSyntaxErrorOffset(self):
252252
check('[\nfile\nfor str(file)\nin\n[]\n]', 3, 5)
253253
check('[file for\n str(file) in []]', 2, 2)
254254
check("ages = {'Alice'=22, 'Bob'=23}", 1, 9)
255-
check('match ...:\n case {**rest, "key": value}:\n ...', 2, 19)
255+
check(dedent("""\
256+
match ...:
257+
case {**rest1, "after": after}:
258+
...
259+
"""), 2, 11)
260+
check(dedent("""\
261+
match ...:
262+
case {"before": before, **rest2, "after": after}:
263+
...
264+
"""), 2, 29)
256265
check("[a b c d e f]", 1, 2)
257266
check("for x yfff:", 1, 7)
258267
check("f(a for a in b, c)", 1, 3, 1, 15)

0 commit comments

Comments
 (0)