mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-08 05:35:22 +00:00
Improve test
This commit is contained in:
parent
393869c47c
commit
d5fc7c4c87
2 changed files with 45 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue