This commit is contained in:
yt2b 2024-01-20 15:30:38 +09:00
parent bc16c9fd8d
commit 29c98d4a2f
2 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,15 @@
---
source: parser/src/string.rs
expression: parse_ast
---
[
Constant(
ExprConstant {
range: 0..10,
value: Str(
"\\{x\\}",
),
kind: None,
},
),
]

View file

@ -960,6 +960,13 @@ mod tests {
insta::assert_debug_snapshot!(parse_ast);
}
#[test]
fn test_parse_fstring_escaped_brackets() {
let source = "\\{{x\\}}";
let parse_ast = parse_fstring(source).unwrap();
insta::assert_debug_snapshot!(parse_ast);
}
#[test]
fn test_parse_string_concat() {
let source = "'Hello ' 'world'";