Skip to content

Commit

Permalink
Add tests and update refs.
Browse files Browse the repository at this point in the history
  • Loading branch information
akshanshbhatt committed Jul 22, 2022
1 parent 0a2f1af commit 7f360fe
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/parser/function_def3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def main0(i, ):
pass


def example(
text,
width=80,
fill_char='-',
): # type: (...) -> str
return


example(text, width=80, fill_char='-',)
13 changes: 13 additions & 0 deletions tests/reference/ast_new-function_def3-f66064a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"basename": "ast_new-function_def3-f66064a",
"cmd": "lpython --show-ast --new-parser --no-color {infile} -o {outfile}",
"infile": "tests/parser/function_def3.py",
"infile_hash": "97ce9a159096686efc19c3bb609a17b94106a317f2166a40d538fe38",
"outfile": null,
"outfile_hash": null,
"stdout": "ast_new-function_def3-f66064a.stdout",
"stdout_hash": "0cbb3db8cff2f87c1035d2fcd49ea8c5a2c3a719eb646f5fc8cb648c",
"stderr": null,
"stderr_hash": null,
"returncode": 0
}
1 change: 1 addition & 0 deletions tests/reference/ast_new-function_def3-f66064a.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(Module [(FunctionDef main0 ([] [(i () ())] [] [] [] [] []) [(Pass)] [] () ()) (FunctionDef example ([] [(text () ()) (width () ()) (fill_char () ())] [] [] [] [] [(ConstantInt 80 ()) (ConstantStr "-" ())]) [(Return ())] [] () "(...) -> str") (Expr (Call (Name example Load) [(Name text Load)] [(width (ConstantInt 80 ())) (fill_char (ConstantStr "-" ()))]))] [])
4 changes: 4 additions & 0 deletions tests/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,10 @@ ast_new = true
filename = "parser/function_def2.py"
ast_new = true

[[test]]
filename = "parser/function_def3.py"
ast_new = true

[[test]]
filename = "parser/class_def1.py"
ast_new = true
Expand Down

0 comments on commit 7f360fe

Please sign in to comment.