Add new with and match sequence test cases (#9128)
## Summary Add new test cases for `with_item` and `match` sequence that demonstrate how long headers break. Removes one use of `optional_parentheses` in a position where it is know that the parentheses always need to be added. ## Test Plan cargo test
This commit is contained in:
@@ -584,6 +584,11 @@ match n % 3, n % 5:
|
||||
print("Buzz")
|
||||
case _:
|
||||
print(n)
|
||||
|
||||
# Unparenthesized tuples
|
||||
match x:
|
||||
case Child(aaaaaaaaa, bbbbbbbbbbbbbbb, cccccc), Doc(aaaaa, bbbbbbbbbb, ddddddddddddd):
|
||||
pass
|
||||
```
|
||||
|
||||
## Output
|
||||
@@ -1210,6 +1215,13 @@ match n % 3, n % 5:
|
||||
print("Buzz")
|
||||
case _:
|
||||
print(n)
|
||||
|
||||
# Unparenthesized tuples
|
||||
match x:
|
||||
case Child(aaaaaaaaa, bbbbbbbbbbbbbbb, cccccc), Doc(
|
||||
aaaaa, bbbbbbbbbb, ddddddddddddd
|
||||
):
|
||||
pass
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -309,6 +309,10 @@ if True:
|
||||
if True:
|
||||
with anyio.CancelScope(shield=True) if get_running_loop() else contextlib.nullcontext():
|
||||
pass
|
||||
|
||||
|
||||
with Child(aaaaaaaaa, bbbbbbbbbbbbbbb, cccccc), Document(aaaaa, bbbbbbbbbb, ddddddddddddd):
|
||||
pass
|
||||
```
|
||||
|
||||
## Output
|
||||
@@ -640,6 +644,12 @@ if True:
|
||||
shield=True
|
||||
) if get_running_loop() else contextlib.nullcontext():
|
||||
pass
|
||||
|
||||
|
||||
with Child(aaaaaaaaa, bbbbbbbbbbbbbbb, cccccc), Document(
|
||||
aaaaa, bbbbbbbbbb, ddddddddddddd
|
||||
):
|
||||
pass
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user