Fix util_test.go
This commit is contained in:
parent
641624ef3b
commit
bfca8c6f4a
12
util_test.go
12
util_test.go
@ -17,17 +17,17 @@ func TestDefaul(test *testing.T) {
|
||||
}
|
||||
|
||||
func TestPanicWrap(test *testing.T) {
|
||||
err := panicWrap(func (ctx context.Context) error {
|
||||
err := panicWrap(func () error {
|
||||
return errors.New("test case 0")
|
||||
})
|
||||
test.Log(err)
|
||||
if err.Error() != "test case 0" { test.Fatal("not equal") }
|
||||
err = panicWrap(func (ctx context.Context) error {
|
||||
err = panicWrap(func () error {
|
||||
panic(errors.New("test case 1"))
|
||||
})
|
||||
test.Log(err)
|
||||
if err.Error() != "test case 1" { test.Fatal("not equal") }
|
||||
err = panicWrap( func (ctx context.Context) error {
|
||||
err = panicWrap( func () error {
|
||||
return nil
|
||||
})
|
||||
test.Log(err)
|
||||
@ -35,17 +35,17 @@ func TestPanicWrap(test *testing.T) {
|
||||
}
|
||||
|
||||
func TestPanicWrapCtx(test *testing.T) {
|
||||
err := panicWrap(context.Background(), func (ctx context.Context) error {
|
||||
err := panicWrapCtx(context.Background(), func (ctx context.Context) error {
|
||||
return errors.New("test case 0")
|
||||
})
|
||||
test.Log(err)
|
||||
if err.Error() != "test case 0" { test.Fatal("not equal") }
|
||||
err = panicWrap(context.Background(), func (ctx context.Context) error {
|
||||
err = panicWrapCtx(context.Background(), func (ctx context.Context) error {
|
||||
panic(errors.New("test case 1"))
|
||||
})
|
||||
test.Log(err)
|
||||
if err.Error() != "test case 1" { test.Fatal("not equal") }
|
||||
err = panicWrap(context.Background(), func (ctx context.Context) error {
|
||||
err = panicWrapCtx(context.Background(), func (ctx context.Context) error {
|
||||
return nil
|
||||
})
|
||||
test.Log(err)
|
||||
|
Loading…
Reference in New Issue
Block a user