Tests[SendToNewChannel]
This commit is contained in:
@@ -2,6 +2,7 @@ package util
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||
"reflect"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
@@ -163,6 +164,14 @@ func TestFailIfErr(t *testing.T, e error) {
|
||||
}
|
||||
}
|
||||
|
||||
func AssertArrAny[T any](t *testing.T, key string, arr []T, fn func(T) bool) {
|
||||
if !langext.ArrAny(arr, fn) {
|
||||
t.Errorf("AssertArrAny(%s) failed", key)
|
||||
t.Error(string(debug.Stack()))
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
||||
func unpointer(v any) any {
|
||||
if v == nil {
|
||||
return v
|
||||
|
||||
Reference in New Issue
Block a user