29 lines
465 B
Go
29 lines
465 B
Go
package require
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func Equal(t *testing.T, expected interface{}, actual interface{}, msgAndArgs ...interface{}) {
|
|
t.Helper()
|
|
|
|
if reflect.DeepEqual(expected, actual) {
|
|
return
|
|
}
|
|
|
|
t.Error(msgAndArgs...)
|
|
t.FailNow()
|
|
}
|
|
|
|
func Equalf(t *testing.T, expected interface{}, actual interface{}, msg string, args ...interface{}) {
|
|
t.Helper()
|
|
|
|
if reflect.DeepEqual(expected, actual) {
|
|
return
|
|
}
|
|
|
|
t.Errorf(msg, args...)
|
|
t.FailNow()
|
|
}
|