From bfca8c6f4a5e7db0b9ae720ad9014074df07ee30 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Thu, 30 Jan 2025 19:59:25 -0500 Subject: [PATCH] Fix util_test.go --- util_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/util_test.go b/util_test.go index c1ae74b..f7ec3bd 100644 --- a/util_test.go +++ b/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)