aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 72e4ab15c87..e0d0445a83d 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -1226,6 +1226,20 @@ Corner-cases that used to crash:
>>> import ä £
Traceback (most recent call last):
SyntaxError: invalid character '£' (U+00A3)
+
+ Invalid pattern matching constructs:
+
+ >>> match ...:
+ ... case 42 as _:
+ ... ...
+ Traceback (most recent call last):
+ SyntaxError: cannot use '_' as a target
+
+ >>> match ...:
+ ... case 42 as 1+2+4:
+ ... ...
+ Traceback (most recent call last):
+ SyntaxError: invalid pattern target
"""
import re