Skip to content

Commit b262219

Browse files
committed
More tests
1 parent f59b4ec commit b262219

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Lib/test/test_syntax.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,26 @@
387387
Traceback (most recent call last):
388388
SyntaxError: cannot use case statement with ellipsis
389389
390+
>>> match ...:
391+
... case 1 // 2: ...
392+
Traceback (most recent call last):
393+
SyntaxError: cannot use case statement with expression
394+
395+
>>> match ...:
396+
... case {1, 2, 3}: ...
397+
Traceback (most recent call last):
398+
SyntaxError: cannot use case statement with set display
399+
400+
>>> match ...:
401+
... case a[0]: ...
402+
Traceback (most recent call last):
403+
SyntaxError: cannot use case statement with subscript
404+
405+
>>> match ...:
406+
... case a[0].method(): ...
407+
Traceback (most recent call last):
408+
SyntaxError: cannot use case statement with function call
409+
390410
# But prefixes of soft keywords should
391411
# still raise specialized errors
392412

0 commit comments

Comments
 (0)