Skip to content

Commit

Permalink
Tests: Add asserts and update test reference
Browse files Browse the repository at this point in the history
  • Loading branch information
kmr-srbh committed Apr 27, 2024
1 parent 61a4419 commit d322154
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions integration_tests/test_intrinsic_function_mixed_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@ def test_intrinsic_function_mixed_print():
# list and list methods
my_list: list[i32] = [1, 2, 3, 4, 5]
print("Popped element:", my_list.pop())
assert my_list == [1, 2, 3, 4]

print("1 is located at:", my_list.index(1))
assert my_list.index(1) == 0

my_list.append(2)
print("2 is present", my_list.count(2), "times")
assert my_list.count(2) == 2

print(my_list.pop(), my_list)
assert my_list == [1, 2, 3, 4]

# dict and dict methods
my_dict: dict[str, i32] = {"first": 1, "second": 2, "third": 3}
print("Keys:", my_dict.keys())
print("Value of 'third':", my_dict.pop("third"))
assert len(my_dict.keys()) == 2

test_intrinsic_function_mixed_print()
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"basename": "runtime-test_intrinsic_function_mixed_print-a862825",
"cmd": "lpython {infile}",
"infile": "tests/../integration_tests/test_intrinsic_function_mixed_print.py",
"infile_hash": "eb30139022c49be86015547192341d98c3b05e74da74e17dc621bef3",
"infile_hash": "b0f779598e5d9868d183f1032fb3f87c131fedacf7848aaed6c4d238",
"outfile": null,
"outfile_hash": null,
"stdout": "runtime-test_intrinsic_function_mixed_print-a862825.stdout",
Expand Down

0 comments on commit d322154

Please sign in to comment.