From a759b9a94874d948379fdc3201146786f61eff6a Mon Sep 17 00:00:00 2001 From: caixw Date: Sat, 16 Mar 2024 23:18:30 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E4=BF=AE=E6=AD=A3=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- option_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/option_test.go b/option_test.go index 99154bb..5dfb21f 100644 --- a/option_test.go +++ b/option_test.go @@ -72,15 +72,15 @@ func TestRecovery(t *testing.T) { a.NotNil(router).NotNil(router.recoverFunc) router.Get("/path", p) - w := httptest.NewRecorder() - r := rest.Get(a, "/path").Request() - a.Go(func(a *assert.Assertion) { + a.NotPanic(func() { + w := httptest.NewRecorder() + r := rest.Get(a, "/path").Request() router.ServeHTTP(w, r) - }). - Wait(time.Microsecond*500). - Contains(out.String(), "panic test", out.String()). - Contains(out.String(), "option_test.go:55", out.String()). - Equal(w.Code, 404) + a.Wait(time.Microsecond*500). + Contains(out.String(), "panic test", out.String()). + Contains(out.String(), "option_test.go:55", out.String()). + Equal(w.Code, 404) + }) // LogRecovery