...
1 package json_test
2
3 import "testing"
4
5 func assertErr(t *testing.T, err error) {
6 t.Helper()
7 if err != nil {
8 t.Fatalf("%+v", err)
9 }
10 }
11
12 func assertEq(t *testing.T, msg string, exp interface{}, act interface{}) {
13 t.Helper()
14 if exp != act {
15 t.Fatalf("failed to test for %s. exp=[%v] but act=[%v]", msg, exp, act)
16 }
17 }
18
19 func assertNeq(t *testing.T, msg string, exp interface{}, act interface{}) {
20 t.Helper()
21 if exp == act {
22 t.Fatalf("failed to test for %s. expected value is not [%v] but got same value", msg, act)
23 }
24 }
25
View as plain text