moved assertEquals to utils so that other tests

can use it
This commit is contained in:
Karma Riuk
2023-08-07 18:18:25 +02:00
parent 36051b06f6
commit 6b045e25e0
2 changed files with 13 additions and 11 deletions

View File

@ -2,6 +2,7 @@ package utils
import (
"log"
"testing"
"golang.org/x/exp/constraints"
)
@ -19,3 +20,10 @@ func Min[T constraints.Ordered](a, b T) T {
}
return b
}
func AssertEqual[T comparable](t *testing.T, got T, want T, msg string, args ...any) {
args = append(args, got, want)
if got != want {
t.Fatalf(msg+"\nGot: %v, Want: %v", args...)
}
}