-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac5c8bb
commit e69ff5d
Showing
6 changed files
with
105 additions
and
32 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/fstring.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
( | ||
f'{one}' | ||
f'{two}' | ||
) | ||
|
||
|
||
rf"Not-so-tricky \"quote" | ||
|
||
# Regression test for fstrings dropping comments | ||
result_f = ( | ||
'Traceback (most recent call last):\n' | ||
f' File "{__file__}", line {lineno_f+5}, in _check_recursive_traceback_display\n' | ||
' f()\n' | ||
f' File "{__file__}", line {lineno_f+1}, in f\n' | ||
' f()\n' | ||
f' File "{__file__}", line {lineno_f+1}, in f\n' | ||
' f()\n' | ||
f' File "{__file__}", line {lineno_f+1}, in f\n' | ||
' f()\n' | ||
# XXX: The following line changes depending on whether the tests | ||
# are run through the interactive interpreter or with -m | ||
# It also varies depending on the platform (stack size) | ||
# Fortunately, we don't care about exactness here, so we use regex | ||
r' \[Previous line repeated (\d+) more times\]' '\n' | ||
'RecursionError: maximum recursion depth exceeded\n' | ||
) |
7 changes: 0 additions & 7 deletions
7
crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/joined_string.py
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
crates/ruff_python_formatter/tests/snapshots/format@expression__fstring.py.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
source: crates/ruff_python_formatter/tests/fixtures.rs | ||
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/fstring.py | ||
--- | ||
## Input | ||
```py | ||
( | ||
f'{one}' | ||
f'{two}' | ||
) | ||
rf"Not-so-tricky \"quote" | ||
# Regression test for fstrings dropping comments | ||
result_f = ( | ||
'Traceback (most recent call last):\n' | ||
f' File "{__file__}", line {lineno_f+5}, in _check_recursive_traceback_display\n' | ||
' f()\n' | ||
f' File "{__file__}", line {lineno_f+1}, in f\n' | ||
' f()\n' | ||
f' File "{__file__}", line {lineno_f+1}, in f\n' | ||
' f()\n' | ||
f' File "{__file__}", line {lineno_f+1}, in f\n' | ||
' f()\n' | ||
# XXX: The following line changes depending on whether the tests | ||
# are run through the interactive interpreter or with -m | ||
# It also varies depending on the platform (stack size) | ||
# Fortunately, we don't care about exactness here, so we use regex | ||
r' \[Previous line repeated (\d+) more times\]' '\n' | ||
'RecursionError: maximum recursion depth exceeded\n' | ||
) | ||
``` | ||
|
||
## Output | ||
```py | ||
(f"{one}" f"{two}") | ||
rf'Not-so-tricky "quote' | ||
# Regression test for fstrings dropping comments | ||
result_f = ( | ||
"Traceback (most recent call last):\n" | ||
f' File "{__file__}", line {lineno_f+5}, in _check_recursive_traceback_display\n' | ||
" f()\n" | ||
f' File "{__file__}", line {lineno_f+1}, in f\n' | ||
" f()\n" | ||
f' File "{__file__}", line {lineno_f+1}, in f\n' | ||
" f()\n" | ||
f' File "{__file__}", line {lineno_f+1}, in f\n' | ||
" f()\n" | ||
# XXX: The following line changes depending on whether the tests | ||
# are run through the interactive interpreter or with -m | ||
# It also varies depending on the platform (stack size) | ||
# Fortunately, we don't care about exactness here, so we use regex | ||
r" \[Previous line repeated (\d+) more times\]" | ||
"\n" | ||
"RecursionError: maximum recursion depth exceeded\n" | ||
) | ||
``` | ||
|
||
|
||
|
25 changes: 0 additions & 25 deletions
25
crates/ruff_python_formatter/tests/snapshots/format@expression__joined_string.py.snap
This file was deleted.
Oops, something went wrong.