Skip to content

Commit 89031a0

Browse files
Add tests and update the refs.
1 parent 72a4611 commit 89031a0

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

tests/parser/dictionary1.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,10 @@ def test():
2323
Text
2424
"""
2525
}
26+
x = { **x,
27+
y: "Text",
28+
**z,
29+
None: "None",
30+
}
2631

2732
test()

tests/reference/ast_new-dictionary1-445e718.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"basename": "ast_new-dictionary1-445e718",
33
"cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}",
44
"infile": "tests/parser/dictionary1.py",
5-
"infile_hash": "78286c2c3a7c6d9117f44c91c603e6fb1c853ca3d67a4cdb18febb9a",
5+
"infile_hash": "68922e77dbabe06c271463150653684880d3c28d88caa44109b2e202",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "ast_new-dictionary1-445e718.stdout",
9-
"stdout_hash": "cb5ae051657fc4158ecfed7d4af3d3f249e58cec2bada5b75863c336",
9+
"stdout_hash": "e9aefdd2d9d42dfe673563ff13d1f91ce6dcd672d1237506f540cb90",
1010
"stderr": null,
1111
"stderr_hash": null,
1212
"returncode": 0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
(Module [(FunctionDef test ([] [] [] [] [] [] []) [(Assign [(Name x Store)] (Dict [] []) ()) (Assign [(Name dict Store)] (Dict [(ConstantStr "brand" ()) (ConstantStr "electric" ()) (ConstantStr "year" ()) (ConstantStr "colors" ())] [(ConstantStr "Ford" ()) (ConstantBool .false. ()) (ConstantInt 1964 ()) (List [(ConstantStr "red" ()) (ConstantStr "white" ())] Load)]) ()) (Assign [(Name num Store)] (Dict [(ConstantInt 1 ()) (ConstantInt 2 ())] [(ConstantInt 2 ()) (ConstantInt 3 ())]) ()) (AnnAssign (Name y Store) (Subscript (Name dict Load) (Tuple [(Name str Load) (Name i32 Load)] Load) Load) () 1) (Assign [(Name y Store)] (Dict [(ConstantStr "a" ()) (ConstantStr "b" ())] [(UnaryOp USub (ConstantInt 1 ())) (UnaryOp USub (ConstantInt 2 ()))]) ()) (Assign [(Name y Store)] (Dict [(ConstantStr "a" ()) (ConstantStr "b" ())] [(UnaryOp USub (ConstantInt 1 ())) (UnaryOp USub (ConstantInt 2 ()))]) ()) (Assign [(Subscript (Name y Load) (ConstantStr "a" ()) Store)] (ConstantInt 123 ()) ()) (Assign [(Name a Store)] (Dict [(ConstantStr "a" ()) (ConstantStr "b" ())] [(ConstantInt 1 ()) (ConstantInt 2 ())]) ()) (Assign [(Name x Store)] (Dict [(ConstantStr "markdown2.tpl" ())] [(ConstantStr "\
22
Text
3-
" ())]) ())] [] () ()) (Expr (Call (Name test Load) [] []))] [(TypeIgnore 0 "")])
3+
" ())]) ()) (Assign [(Name x Store)] (Dict [(ConstantNone ()) (Name y Load) (ConstantNone ()) (ConstantNone ())] [(Name x Load) (ConstantStr "Text" ()) (Name z Load) (ConstantStr "None" ())]) ())] [] () ()) (Expr (Call (Name test Load) [] []))] [(TypeIgnore 0 "")])

0 commit comments

Comments
 (0)