mirror of https://github.com/goccy/go-json.git
change assertEq check
This commit is contained in:
parent
5f0b34250c
commit
4fe8e6f172
|
@ -11,7 +11,7 @@ func assertErr(t *testing.T, err error) {
|
||||||
|
|
||||||
func assertEq(t *testing.T, msg string, exp interface{}, act interface{}) {
|
func assertEq(t *testing.T, msg string, exp interface{}, act interface{}) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
if exp != act && exp != nil && act != nil {
|
if exp != act && !(exp == nil && act == nil) {
|
||||||
t.Fatalf("failed to test for %s. exp=[%v] but act=[%v]", msg, exp, act)
|
t.Fatalf("failed to test for %s. exp=[%v] but act=[%v]", msg, exp, act)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue