moved assertEquals to utils so that other tests
can use it
This commit is contained in:
@ -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...)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user