func TestPanicInHandler(t *testing.T) {
	buffer := new(bytes.Buffer)
	router := ego.New()
	router.Use(RecoveryWithWriter(buffer))
	router.GET("/recovery", func(_ *ego.Context) {
		panic("Oupps, Houston, we have a problem")
	})
	w := performRequest(router, "GET", "/recovery")
	assert.Equal(t, 500, w.Code)
	assert.Contains(t, buffer.String(), "GET /recovery")
	assert.Contains(t, buffer.String(), "Oupps, Houston, we have a problem")
	assert.Contains(t, buffer.String(), "TestPanicInHandler")
}
TestPanicInHandler assert that panic has been recovered.
package mid
import (
	"bytes"
	"testing"
	"github.com/go-ego/ego"
	"github.com/stretchr/testify/assert"
)