mirror of
https://github.com/fatedier/frp.git
synced 2024-12-16 03:19:00 +08:00
17 lines
244 B
Go
17 lines
244 B
Go
|
package errors
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestPanicToError(t *testing.T) {
|
||
|
assert := assert.New(t)
|
||
|
|
||
|
err := PanicToError(func() {
|
||
|
panic("test error")
|
||
|
})
|
||
|
assert.Contains(err.Error(), "test error")
|
||
|
}
|