mirror of
https://github.com/fatedier/frp.git
synced 2026-01-11 22:23:12 +00:00
test: add test case
This commit is contained in:
16
utils/errors/errors_test.go
Normal file
16
utils/errors/errors_test.go
Normal file
@@ -0,0 +1,16 @@
|
||||
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")
|
||||
}
|
||||
Reference in New Issue
Block a user