Skip to content

Commit

Permalink
Expand tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tjkuson committed Aug 18, 2023
1 parent c2098c6 commit 68fe3f1
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,48 @@
while True:
...

if True:
# comment
...

with True:
... # comment

for i in []:
...

for i in []:
# comment
...

for i in []:
... # comment

if True:
...

if True:
# comment
...

if True:
... # comment

with True:
...

with True:
# comment
...

with True:
... # comment

match x:
case 1:
...
...
case 2:
# comment
...
case 3:
... # comment
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,97 @@ input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/statement/
while True:
...
if True:
# comment
...
with True:
... # comment
for i in []:
...
for i in []:
# comment
...
for i in []:
... # comment
if True:
...
if True:
# comment
...
if True:
... # comment
with True:
...
with True:
# comment
...
with True:
... # comment
match x:
case 1:
...```
...
case 2:
# comment
...
case 3:
... # comment
```

## Output
```py
"""Compound statements with no body should be written on one line."""
while True: ...
if True:
# comment
...
with True: ... # comment
for i in []: ...
for i in []:
# comment
...
for i in []: ... # comment
if True: ...
if True:
# comment
...
if True: ... # comment
with True: ...
with True:
# comment
...
with True: ... # comment
match x:
case "NOT_YET_IMPLEMENTED_PatternMatchValue":
...
case "NOT_YET_IMPLEMENTED_PatternMatchValue":
# comment
...
case "NOT_YET_IMPLEMENTED_PatternMatchValue":
... # comment
```


Expand Down

0 comments on commit 68fe3f1

Please sign in to comment.