Skip to content

Commit

Permalink
test: 修正测试错误
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Mar 16, 2024
1 parent 253bb02 commit a759b9a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a759b9a

Please sign in to comment.