summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBrandt Bucher <brandt@python.org>2021-04-30 00:19:28 (GMT)
committerGitHub <noreply@github.com>2021-04-30 00:19:28 (GMT)
commitdbe60ee09dc5a624cfb78dff61ecf050a5b3f105 (patch)
treecb0850e50916b666879770be4fb42b473db357e8 /Lib
parent87655e2cf58c543914ea05ebe5a0377441da1ef2 (diff)
downloadcpython-dbe60ee09dc5a624cfb78dff61ecf050a5b3f105.zip
cpython-dbe60ee09dc5a624cfb78dff61ecf050a5b3f105.tar.gz
cpython-dbe60ee09dc5a624cfb78dff61ecf050a5b3f105.tar.bz2
bpo-43892: Validate the first term of complex literal value patterns (GH-25735)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_patma.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/Lib/test/test_patma.py b/Lib/test/test_patma.py
index f327552..1f80fb4 100644
--- a/Lib/test/test_patma.py
+++ b/Lib/test/test_patma.py
@@ -2873,6 +2873,38 @@ class TestPatma(unittest.TestCase):
pass
""")
+ @no_perf
+ def test_patma_285(self):
+ self.assert_syntax_error("""
+ match ...:
+ case 0j+0:
+ pass
+ """)
+
+ @no_perf
+ def test_patma_286(self):
+ self.assert_syntax_error("""
+ match ...:
+ case 0j+0j:
+ pass
+ """)
+
+ @no_perf
+ def test_patma_287(self):
+ self.assert_syntax_error("""
+ match ...:
+ case {0j+0: _}:
+ pass
+ """)
+
+ @no_perf
+ def test_patma_288(self):
+ self.assert_syntax_error("""
+ match ...:
+ case {0j+0j: _}:
+ pass
+ """)
+
class PerfPatma(TestPatma):