diff options
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r-- | Lib/test/test_syntax.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index e0d0445a83..ad5656bac6 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -1240,6 +1240,30 @@ Corner-cases that used to crash: ... ... Traceback (most recent call last): SyntaxError: invalid pattern target + + >>> match ...: + ... case Foo(z=1, y=2, x): + ... ... + Traceback (most recent call last): + SyntaxError: positional patterns follow keyword patterns + + >>> match ...: + ... case Foo(a, z=1, y=2, x): + ... ... + Traceback (most recent call last): + SyntaxError: positional patterns follow keyword patterns + + >>> match ...: + ... case Foo(z=1, x, y=2): + ... ... + Traceback (most recent call last): + SyntaxError: positional patterns follow keyword patterns + + >>> match ...: + ... case C(a=b, c, d=e, f, g=h, i, j=k, ...): + ... ... + Traceback (most recent call last): + SyntaxError: positional patterns follow keyword patterns """ import re |