Skip to content

Commit

Permalink
New tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rdrll committed Mar 15, 2024
1 parent a12c5a1 commit c87416a
Showing 1 changed file with 43 additions and 27 deletions.
70 changes: 43 additions & 27 deletions tests/data/cases/pattern_matching_with_if_stmt.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
# flags: --preview --minimum-version=3.10
match "test":
case "test" if "first long condition" != "some loooooooooooooooooooooooooooooooooooooog condition":
print("Test")

match match:
case "test" if case != "not very loooooooooooooog condition":
print("No format change")
case "test" if case != "not very loooooooooooooog condition": # comment
pass

match "test":
match smth:
case "test" if "any long condition" != "another long condition" and "this is a long condition":
print("Test")

match "test":
case "test" if "any long condition" != "another long condition" and "this is a looooong condition":
print("Test")
pass
case test if "any long condition" != "another long condition" and "this is a looooong condition":
pass
case test if "any long condition" != "another long condition" and "this is a looooong condition": # some additional comments
pass
case test if (True): # some comment
pass
case test if (False
): # some comment
pass
case test if (True # some comment
):
pass # some comment
case cases if (True # some comment
): # some other comment
pass # some comment
case match if (True # some comment
):
pass # some comment

# case black_test_patma_052 (originally in the pattern_matching_complex test case)
match x:
Expand All @@ -24,29 +34,35 @@

# output

match "test":
case "test" if (
"first long condition"
!= "some loooooooooooooooooooooooooooooooooooooog condition"
):
print("Test")

match match:
case "test" if case != "not very loooooooooooooog condition":
print("No format change")
case "test" if case != "not very loooooooooooooog condition": # comment
pass

match "test":
match smth:
case "test" if (
"any long condition" != "another long condition" and "this is a long condition"
):
print("Test")

match "test":
case "test" if (
pass
case test if (
"any long condition" != "another long condition"
and "this is a looooong condition"
):
print("Test")
pass
case test if (
"any long condition" != "another long condition"
and "this is a looooong condition"
): # some additional comments
pass
case test if True: # some comment
pass
case test if False: # some comment
pass
case test if True: # some comment
pass # some comment
case cases if True: # some comment # some other comment
pass # some comment
case match if True: # some comment
pass # some comment

# case black_test_patma_052 (originally in the pattern_matching_complex test case)
match x:
Expand Down

0 comments on commit c87416a

Please sign in to comment.