Fix tests
This commit is contained in:
@@ -400,7 +400,7 @@ func ArrCastErr[T1 any, T2 any](arr []T1) ([]T2, error) {
|
||||
if vcast, ok := any(v).(T2); ok {
|
||||
r[i] = vcast
|
||||
} else {
|
||||
return nil, errors.New(fmt.Sprintf("Cannot cast element %d of type %T to type %s", i, v, *new(T2)))
|
||||
return nil, errors.New(fmt.Sprintf("Cannot cast element %d of type %T to type %v", i, v, *new(T2)))
|
||||
}
|
||||
}
|
||||
return r, nil
|
||||
@@ -412,7 +412,7 @@ func ArrCastPanic[T1 any, T2 any](arr []T1) []T2 {
|
||||
if vcast, ok := any(v).(T2); ok {
|
||||
r[i] = vcast
|
||||
} else {
|
||||
panic(fmt.Sprintf("Cannot cast element %d of type %T to type %s", i, v, *new(T2)))
|
||||
panic(fmt.Sprintf("Cannot cast element %d of type %T to type %v", i, v, *new(T2)))
|
||||
}
|
||||
}
|
||||
return r
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package langext
|
||||
|
||||
import (
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/tst"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -60,7 +61,7 @@ func TestBase58FlickrDecoding(t *testing.T) {
|
||||
tst.AssertEqual(t, _decStr(t, Base58FlickrEncoding, "48638rmBiUzG5NKQoX4KcuE5C8paCFACnE28F7qDx13PRtennAmYSSJQ5gJSRihf5ZDyEQS4UimtihR7uARt4wbty2fW9duTQTM9n1DwUBevreyzGwu6W4YSgrvQgCPDxsiE1mCdZsF8VEBpuHHEiJyw"), "If debugging is the process of removing software bugs, then programming must be the process of putting them in.")
|
||||
}
|
||||
|
||||
func tst.AssertEqual(t *testing.T, actual string, expected string) {
|
||||
func assertEqual(t *testing.T, actual string, expected string) {
|
||||
if actual != expected {
|
||||
t.Errorf("values differ: Actual: '%v', Expected: '%v'", actual, expected)
|
||||
}
|
||||
|
Reference in New Issue
Block a user