Skip to content

Commit 1e15742

Browse files
kmr-srbhubaidsk
authored andcommitted
Tests: Add asserts and update test reference
1 parent 25969e8 commit 1e15742

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

integration_tests/test_intrinsic_function_mixed_print.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,22 @@ def test_intrinsic_function_mixed_print():
44
# list and list methods
55
my_list: list[i32] = [1, 2, 3, 4, 5]
66
print("Popped element:", my_list.pop())
7+
assert my_list == [1, 2, 3, 4]
8+
79
print("1 is located at:", my_list.index(1))
10+
assert my_list.index(1) == 0
11+
812
my_list.append(2)
913
print("2 is present", my_list.count(2), "times")
14+
assert my_list.count(2) == 2
15+
1016
print(my_list.pop(), my_list)
17+
assert my_list == [1, 2, 3, 4]
1118

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

1725
test_intrinsic_function_mixed_print()

tests/reference/runtime-test_intrinsic_function_mixed_print-a862825.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"basename": "runtime-test_intrinsic_function_mixed_print-a862825",
33
"cmd": "lpython {infile}",
44
"infile": "tests/../integration_tests/test_intrinsic_function_mixed_print.py",
5-
"infile_hash": "eb30139022c49be86015547192341d98c3b05e74da74e17dc621bef3",
5+
"infile_hash": "b0f779598e5d9868d183f1032fb3f87c131fedacf7848aaed6c4d238",
66
"outfile": null,
77
"outfile_hash": null,
88
"stdout": "runtime-test_intrinsic_function_mixed_print-a862825.stdout",

0 commit comments

Comments
 (0)