lishwist/core/internal/fixtures/assert.go

32 lines
683 B
Go

package fixtures
import "testing"
// Deprecated: use internal/assert
func AssertEq[C comparable](t *testing.T, context string, expected, actual C) {
if expected != actual {
t.Errorf("%s: %#v != %#v", context, expected, actual)
}
}
// Deprecated: use internal/assert
func Assert(t *testing.T, context string, condition bool) {
if !condition {
t.Errorf("%s", context)
}
}
// Deprecated: use internal/assert
func FatalAssert(t *testing.T, context string, condition bool) {
if !condition {
t.Fatalf("%s", context)
}
}
// Deprecated: use internal/assert
func FailIfErr(t *testing.T, err error, context string) {
if err != nil {
t.Fatalf("%s: %s\n", context, err)
}
}