File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
ruff_linter/resources/test/fixtures/ruff
ruff_python_parser/src/parser Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -79,3 +79,8 @@ def in_type_def():
7979 from typing import cast
8080 a = 'int'
8181 cast ('f"{a}"' ,'11' )
82+
83+ # Regression test for parser bug
84+ # https://github.com/astral-sh/ruff/issues/18860
85+ def fuzz_bug ():
86+ c ('{\t "i}' )
Original file line number Diff line number Diff line change @@ -134,3 +134,26 @@ foo.bar[0].baz[2].egg??
134134 . unwrap ( ) ;
135135 insta:: assert_debug_snapshot!( parsed. syntax( ) ) ;
136136}
137+
138+ #[ test]
139+ fn test_fstring_expr_inner_line_continuation_and_t_string ( ) {
140+ let source = r#"f'{\t"i}'"# ;
141+
142+ let parsed = parse_expression ( source) ;
143+
144+ let error = parsed. unwrap_err ( ) ;
145+
146+ insta:: assert_debug_snapshot!( error) ;
147+ }
148+
149+ #[ test]
150+ fn test_fstring_expr_inner_line_continuation_newline_t_string ( ) {
151+ let source = r#"f'{\
152+ t"i}'"# ;
153+
154+ let parsed = parse_expression ( source) ;
155+
156+ let error = parsed. unwrap_err ( ) ;
157+
158+ insta:: assert_debug_snapshot!( error) ;
159+ }
You can’t perform that action at this time.
0 commit comments