Skip to content

Commit 89da38f

Browse files
committed
Added parse test for function
1 parent d99e270 commit 89da38f

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

bindings/python/tests/test_parse.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def test_function_decl_without_parameters(tmp_path):
144144

145145
assert func_decl["kind"] == "FUNCTION_DECL"
146146
assert func_decl["name"] == "aFunction"
147-
# assert func_decl["result_type"] = "int"
147+
assert func_decl["result_type"] == "int"
148148

149149

150150
def test_function_decl_with_parameters(tmp_path):
@@ -157,7 +157,16 @@ def test_function_decl_with_parameters(tmp_path):
157157

158158
assert func_decl["kind"] == "FUNCTION_DECL"
159159
assert func_decl["name"] == "aFunction"
160-
# assert func_decl["result_type"] = "int"
160+
assert func_decl["result_type"] == "int"
161+
162+
first_param = func_decl["members"][0]
163+
second_param = func_decl["members"][1]
164+
165+
assert first_param["name"] == "firstParam"
166+
assert first_param["element_type"] == "Int"
167+
168+
assert second_param["name"] == "secondParam"
169+
assert second_param["element_type"] == "Double"
161170

162171

163172
def test_simple_call_expr(tmp_path):

0 commit comments

Comments
 (0)