| 12 | ) |
| 13 | |
| 14 | func AssertObjEqual(t *testing.T, r, e interface{}, names ...string) { |
| 15 | for _, name := range names { |
| 16 | rv := reflect.Indirect(reflect.ValueOf(r)) |
| 17 | ev := reflect.Indirect(reflect.ValueOf(e)) |
| 18 | if rv.IsValid() != ev.IsValid() { |
| 19 | t.Errorf("%v: expect: %+v, got %+v", utils.FileWithLineNum(), r, e) |
| 20 | return |
| 21 | } |
| 22 | got := rv.FieldByName(name).Interface() |
| 23 | expect := ev.FieldByName(name).Interface() |
| 24 | t.Run(name, func(t *testing.T) { |
| 25 | AssertEqual(t, got, expect) |
| 26 | }) |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | func AssertEqual(t *testing.T, got, expect interface{}) { |
| 31 | if !reflect.DeepEqual(got, expect) { |