mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-23 17:41:05 +01:00
updated tests for new behavior
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/yusing/go-proxy/internal/common"
|
||||
E "github.com/yusing/go-proxy/internal/error"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -96,3 +97,17 @@ func ExpectType[T any](t *testing.T, got any) (_ T) {
|
||||
}
|
||||
return got.(T)
|
||||
}
|
||||
|
||||
func Must[T any](v T, err E.NestedError) T {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
func Must2[T any](v T, err error) T {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user