black/tests/data/cases/pattern_matching_style.py
Jelle Zijlstra a69bda3b9b
Use inline flags for test cases (#3931)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2023-10-09 18:43:47 -07:00

93 lines
1.1 KiB
Python

# flags: --minimum-version=3.10
match something:
case b(): print(1+1)
case c(
very_complex=True,
perhaps_even_loooooooooooooooooooooooooooooooooooooong=- 1
): print(1)
case c(
very_complex=True,
perhaps_even_loooooooooooooooooooooooooooooooooooooong=-1,
): print(2)
case a: pass
match(
arg # comment
)
match(
)
match(
)
case(
arg # comment
)
case(
)
case(
)
re.match(
something # fast
)
re.match(
)
match match(
):
case case(
arg, # comment
):
pass
# output
match something:
case b():
print(1 + 1)
case c(
very_complex=True, perhaps_even_loooooooooooooooooooooooooooooooooooooong=-1
):
print(1)
case c(
very_complex=True,
perhaps_even_loooooooooooooooooooooooooooooooooooooong=-1,
):
print(2)
case a:
pass
match(arg) # comment
match()
match()
case(arg) # comment
case()
case()
re.match(something) # fast
re.match()
match match():
case case(
arg, # comment
):
pass