16 lines
258 B
Go
16 lines
258 B
Go
package testx
|
|
|
|
import "testing"
|
|
|
|
func Expect(t *testing.T, cond bool, message ...any) {
|
|
t.Helper()
|
|
|
|
if !cond {
|
|
if len(message) == 0 {
|
|
message = append(message, "assertion failed")
|
|
}
|
|
|
|
str := message[0].(string)
|
|
t.Fatalf(str, message[1:]...)
|
|
}
|
|
}
|