Bugfix: Use "%#v" when formatting structs (#4600)

This commit is contained in:
Freddy 2018-08-28 12:37:34 -04:00 committed by GitHub
parent 82f9e48a18
commit d7a404f2ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -61,7 +61,7 @@ func TestStateStore_GetNodeID(t *testing.T) {
t.Fatalf("got err %s want nil", err)
}
if out == nil || out.ID != nodeID {
t.Fatalf("out should not be nil and contain nodeId, but was:=%#q", out)
t.Fatalf("out should not be nil and contain nodeId, but was:=%#v", out)
}
// Case insensitive lookup should work as well
_, out, err = s.GetNodeID(types.NodeID("00a916bC-a357-4a19-b886-59419fceeAAA"))
@ -69,7 +69,7 @@ func TestStateStore_GetNodeID(t *testing.T) {
t.Fatalf("got err %s want nil", err)
}
if out == nil || out.ID != nodeID {
t.Fatalf("out should not be nil and contain nodeId, but was:=%#q", out)
t.Fatalf("out should not be nil and contain nodeId, but was:=%#v", out)
}
}

View File

@ -32,7 +32,7 @@ func WaitUntilNoLeader(t *testing.T, rpc rpcFn, dc string) {
retry.Run(t, func(r *retry.R) {
args := &structs.DCSpecificRequest{Datacenter: dc}
if err := rpc("Catalog.ListNodes", args, &out); err == nil {
r.Fatalf("It still has a leader: %#q", out)
r.Fatalf("It still has a leader: %#v", out)
}
if out.QueryMeta.KnownLeader {
r.Fatalf("Has still a leader")