From 6a386649d02347d687cad796212cdb341649a479 Mon Sep 17 00:00:00 2001 From: martinvuyk Date: Thu, 19 Dec 2024 10:22:05 -0300 Subject: [PATCH] fix assert true test Signed-off-by: martinvuyk --- stdlib/test/testing/test_assertion.mojo | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/stdlib/test/testing/test_assertion.mojo b/stdlib/test/testing/test_assertion.mojo index c30274cb94..c9aaaf6d9d 100644 --- a/stdlib/test/testing/test_assertion.mojo +++ b/stdlib/test/testing/test_assertion.mojo @@ -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