diff --git a/api/helpers_test.go b/api/helpers_test.go index 89800d9..966aedc 100644 --- a/api/helpers_test.go +++ b/api/helpers_test.go @@ -10,11 +10,11 @@ import ( func normalize(v interface{}) { j, err := json.Marshal(v) if err != nil { - panic(fmt.Sprintf("Could not normalize object %+v due to JSON marshalling error: %s", err)) + panic(fmt.Sprintf("Could not normalize object %+v due to JSON marshalling error: %s", v, err)) } err = json.Unmarshal(j, v) if err != nil { - panic(fmt.Sprintf("Could not normalize object %+v due to JSON un-marshalling error: %s", err)) + panic(fmt.Sprintf("Could not normalize object %+v due to JSON un-marshalling error: %s", v, err)) } } diff --git a/api/users_test.go b/api/users_test.go index cba622d..232178c 100644 --- a/api/users_test.go +++ b/api/users_test.go @@ -83,9 +83,8 @@ func TestUser_List(t *testing.T) { if !calledList { t.Error("!calledList") } - for i, _ := range users { - if !normalizeDeepEqual(wantUsers[i], users[i]) { - t.Errorf("got users %+v but wanted users %+v", wantUsers, users) - } + + if !normalizeDeepEqual(&wantUsers, &users) { + t.Errorf("got users %+v but wanted users %+v", users, wantUsers) } }