From f6b4a788dca909578ce6f9a6d2179a1d13e3db17 Mon Sep 17 00:00:00 2001 From: linhpn99 Date: Thu, 4 Jul 2024 22:33:40 +0700 Subject: [PATCH] fix output of PanicsWithMessage --- examples/gno.land/p/demo/uassert/uassert.gno | 2 +- examples/gno.land/p/demo/uassert/uassert_test.gno | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/gno.land/p/demo/uassert/uassert.gno b/examples/gno.land/p/demo/uassert/uassert.gno index 61885574360..89fc11f992d 100644 --- a/examples/gno.land/p/demo/uassert/uassert.gno +++ b/examples/gno.land/p/demo/uassert/uassert.gno @@ -88,7 +88,7 @@ func PanicsWithMessage(t TestingT, msg string, f func(), msgs ...string) bool { } if panicValue != msg { - return fail(t, msgs, "func should panic with message:\t%s\n\tPanic value:\t%s", panicValue, msg) + return fail(t, msgs, "func should panic with message:\t%s\n\tPanic value:\t%s", msg, panicValue) } return true } diff --git a/examples/gno.land/p/demo/uassert/uassert_test.gno b/examples/gno.land/p/demo/uassert/uassert_test.gno index a881070a04b..bd1194c4dff 100644 --- a/examples/gno.land/p/demo/uassert/uassert_test.gno +++ b/examples/gno.land/p/demo/uassert/uassert_test.gno @@ -89,14 +89,14 @@ func TestPanicsWithMessage(t *testing.T) { }) { t.Error("PanicsWithMessage should return false") } - mockT.equals(t, "error: func should panic with message:\tpanic\n\tPanic value:\tat the disco") + mockT.equals(t, "error: func should panic with message:\tat the disco\n\tPanic value:\tpanic") if PanicsWithMessage(mockT, "Panic!", func() { panic("panic") }) { t.Error("PanicsWithMessage should return false") } - mockT.equals(t, "error: func should panic with message:\tpanic\n\tPanic value:\tPanic!") + mockT.equals(t, "error: func should panic with message:\tPanic!\n\tPanic value:\tpanic") } func TestNotPanics(t *testing.T) {