Improve test

This commit is contained in:
harupy 2023-01-15 16:53:13 +09:00
parent d7f5dadf47
commit a7f1904564
2 changed files with 45 additions and 5 deletions

View file

@ -312,7 +312,7 @@ with (0 as a, 1 as b,): pass
#[test] #[test]
fn test_dict_containing_spread() { fn test_dict_containing_spread() {
let parse_ast = parse_expression(r#"{"k": "v", **d}"#, "<test>").unwrap(); let parse_ast = parse_expression(r#"{"a": "b", **c, "d": "e"}"#, "<test>").unwrap();
insta::assert_debug_snapshot!(parse_ast); insta::assert_debug_snapshot!(parse_ast);
} }
} }

View file

@ -10,7 +10,7 @@ Located {
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 15, column: 25,
}, },
), ),
custom: (), custom: (),
@ -31,13 +31,34 @@ Located {
custom: (), custom: (),
node: Constant { node: Constant {
value: Str( value: Str(
"k", "a",
), ),
kind: None, kind: None,
}, },
}, },
), ),
None, None,
Some(
Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 19,
},
),
custom: (),
node: Constant {
value: Str(
"d",
),
kind: None,
},
},
),
], ],
values: [ values: [
Located { Located {
@ -54,7 +75,7 @@ Located {
custom: (), custom: (),
node: Constant { node: Constant {
value: Str( value: Str(
"v", "b",
), ),
kind: None, kind: None,
}, },
@ -72,10 +93,29 @@ Located {
), ),
custom: (), custom: (),
node: Name { node: Name {
id: "d", id: "c",
ctx: Load, ctx: Load,
}, },
}, },
Located {
location: Location {
row: 1,
column: 21,
},
end_location: Some(
Location {
row: 1,
column: 24,
},
),
custom: (),
node: Constant {
value: Str(
"e",
),
kind: None,
},
},
], ],
}, },
} }