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]
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);
}
}

View file

@ -10,7 +10,7 @@ Located {
end_location: Some(
Location {
row: 1,
column: 15,
column: 25,
},
),
custom: (),
@ -31,13 +31,34 @@ Located {
custom: (),
node: Constant {
value: Str(
"k",
"a",
),
kind: 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: [
Located {
@ -54,7 +75,7 @@ Located {
custom: (),
node: Constant {
value: Str(
"v",
"b",
),
kind: None,
},
@ -72,10 +93,29 @@ Located {
),
custom: (),
node: Name {
id: "d",
id: "c",
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,
},
},
],
},
}