Skip to content

Commit dda16a0

Browse files
committed
test commutativity
1 parent 1ec0fad commit dda16a0

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/test_compare.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,13 @@ def test_cmp1_no_pass(str_lhs, str_rhs, str_expected):
242242
else:
243243
expr = str_lhs + " == " + str_rhs
244244
check_evaluation(expr, str_expected,to_string_expr=True, to_string_expected=True)
245+
# Checking commutativity
246+
str_expected_members = str_expected[1:-1].split(" == ")
247+
if len(str_expected_members) == 2:
248+
str_expected = '"' + str_expected_members[1] + " == " + str_expected_members[0] + '"'
249+
expr = str_rhs + " == " + str_lhs
250+
check_evaluation(expr, str_expected,to_string_expr=True, to_string_expected=True)
251+
245252

246253

247254

0 commit comments

Comments
 (0)