Skip to content

Commit dd12dd9

Browse files
committed
Add more regression tests
1 parent 65b6600 commit dd12dd9

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/fstring.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,17 @@
317317
# comment 28
318318
} woah {x}"
319319

320+
321+
f"""{foo
322+
:a{
323+
a # comment 29
324+
# comment 30
325+
}
326+
}"""
327+
320328
# Regression test for https://github.com/astral-sh/ruff/issues/18672
321329
f"{
322-
# comment 29
330+
# comment 31
323331
foo
324332
:>
325333
}"

crates/ruff_python_formatter/tests/snapshots/format@expression__fstring.py.snap

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,17 @@ f"{ # comment 26
323323
# comment 28
324324
} woah {x}"
325325
326+
327+
f"""{foo
328+
:a{
329+
a # comment 29
330+
# comment 30
331+
}
332+
}"""
333+
326334
# Regression test for https://github.com/astral-sh/ruff/issues/18672
327335
f"{
328-
# comment 29
336+
# comment 31
329337
foo
330338
:>
331339
}"
@@ -1095,9 +1103,17 @@ f"{ # comment 26
10951103
# comment 28
10961104
}} woah {x}"
10971105
1106+
1107+
f"""{
1108+
foo:a{
1109+
a # comment 29
1110+
# comment 30
1111+
}
1112+
}"""
1113+
10981114
# Regression test for https://github.com/astral-sh/ruff/issues/18672
10991115
f"{
1100-
# comment 29
1116+
# comment 31
11011117
foo:>}"
11021118
11031119
# Assignment statement
@@ -1907,9 +1923,17 @@ f"{ # comment 26
19071923
# comment 28
19081924
}} woah {x}"
19091925
1926+
1927+
f"""{
1928+
foo:a{
1929+
a # comment 29
1930+
# comment 30
1931+
}
1932+
}"""
1933+
19101934
# Regression test for https://github.com/astral-sh/ruff/issues/18672
19111935
f"{
1912-
# comment 29
1936+
# comment 31
19131937
foo:>}"
19141938
19151939
# Assignment statement

0 commit comments

Comments
 (0)