Skip to content

Commit

Permalink
fix assert true test
Browse files Browse the repository at this point in the history
Signed-off-by: martinvuyk <[email protected]>
  • Loading branch information
martinvuyk committed Dec 19, 2024
1 parent a0ec560 commit 6a38664
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions stdlib/test/testing/test_assertion.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,27 @@ from utils import StringSlice


def test_assert_messages():
assertion = "test_assertion.mojo:"
assertion_error = ": AssertionError:"
try:
assert_true(False)
except e:
assert_true("test_assertion.mojo:33:20: AssertionError:" in str(e))
assert_true(assertion in str(e) and assertion_error in str(e))

try:
assert_false(True)
except e:
assert_true("test_assertion.mojo:38:21: AssertionError:" in str(e))
assert_true(assertion in str(e) and assertion_error in str(e))

try:
assert_equal(1, 0)
except e:
assert_true("test_assertion.mojo:43:21: AssertionError:" in str(e))
assert_true(assertion in str(e) and assertion_error in str(e))

try:
assert_not_equal(0, 0)
except e:
assert_true("test_assertion.mojo:48:25: AssertionError:" in str(e))
assert_true(assertion in str(e) and assertion_error in str(e))


@value
Expand Down

0 comments on commit 6a38664

Please sign in to comment.