Skip to content

Commit d5fc7c4

Browse files
committed
Improve test
1 parent 393869c commit d5fc7c4

2 files changed

Lines changed: 45 additions & 5 deletions

File tree

‎parser/src/parser.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ with (0 as a, 1 as b,): pass
312312

313313
#[test]
314314
fn test_dict_containing_spread() {
315-
let parse_ast = parse_expression(r#"{"k": "v", **d}"#, "<test>").unwrap();
315+
let parse_ast = parse_expression(r#"{"a": "b", **c, "d": "e"}"#, "<test>").unwrap();
316316
insta::assert_debug_snapshot!(parse_ast);
317317
}
318318
}

‎parser/src/snapshots/rustpython_parser__parser__tests__dict_containing_spread.snap‎

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Located {
1010
end_location: Some(
1111
Location {
1212
row: 1,
13-
column: 15,
13+
column: 25,
1414
},
1515
),
1616
custom: (),
@@ -31,13 +31,34 @@ Located {
3131
custom: (),
3232
node: Constant {
3333
value: Str(
34-
"k",
34+
"a",
3535
),
3636
kind: None,
3737
},
3838
},
3939
),
4040
None,
41+
Some(
42+
Located {
43+
location: Location {
44+
row: 1,
45+
column: 16,
46+
},
47+
end_location: Some(
48+
Location {
49+
row: 1,
50+
column: 19,
51+
},
52+
),
53+
custom: (),
54+
node: Constant {
55+
value: Str(
56+
"d",
57+
),
58+
kind: None,
59+
},
60+
},
61+
),
4162
],
4263
values: [
4364
Located {
@@ -54,7 +75,7 @@ Located {
5475
custom: (),
5576
node: Constant {
5677
value: Str(
57-
"v",
78+
"b",
5879
),
5980
kind: None,
6081
},
@@ -72,10 +93,29 @@ Located {
7293
),
7394
custom: (),
7495
node: Name {
75-
id: "d",
96+
id: "c",
7697
ctx: Load,
7798
},
7899
},
100+
Located {
101+
location: Location {
102+
row: 1,
103+
column: 21,
104+
},
105+
end_location: Some(
106+
Location {
107+
row: 1,
108+
column: 24,
109+
},
110+
),
111+
custom: (),
112+
node: Constant {
113+
value: Str(
114+
"e",
115+
),
116+
kind: None,
117+
},
118+
},
79119
],
80120
},
81121
}

0 commit comments

Comments
 (0)