fix fmt str

This commit is contained in:
wangkechun 2017-02-25 22:53:25 +08:00
parent 0f75420692
commit 059b9d36d7
5 changed files with 5 additions and 5 deletions

View File

@ -72,7 +72,7 @@ func testPool(t *testing.T, size int, ttl time.Duration) {
p.Lock()
if i := len(p.conns[l.Addr()]); i > size {
p.Unlock()
t.Fatal("pool size %d is greater than expected %d", i, size)
t.Fatalf("pool size %d is greater than expected %d", i, size)
}
p.Unlock()
}

View File

@ -37,7 +37,7 @@ func TestErrors(t *testing.T) {
}
if pe.Code != e.Code {
t.Fatalf("Expected %s got %s", e.Code, pe.Code)
t.Fatalf("Expected %d got %d", e.Code, pe.Code)
}
if pe.Status != e.Status {

View File

@ -96,7 +96,7 @@ func TestMDNS(t *testing.T) {
}
if node.Port != service.Nodes[0].Port {
t.Fatalf("Expected node port %s got %s", service.Nodes[0].Port, node.Port)
t.Fatalf("Expected node port %d got %d", service.Nodes[0].Port, node.Port)
}
}

View File

@ -81,7 +81,7 @@ func TestWatcher(t *testing.T) {
}
if node.Port != service.Nodes[0].Port {
t.Fatalf("Expected node port %s got %s", service.Nodes[0].Port, node.Port)
t.Fatalf("Expected node port %d got %d", service.Nodes[0].Port, node.Port)
}
}

View File

@ -166,7 +166,7 @@ func TestFilterLabel(t *testing.T) {
for _, node := range service.Nodes {
if node.Metadata[data.label[0]] != data.label[1] {
t.Fatal("Expected %s=%s but got %s=%s for service %+v node %+v",
t.Fatalf("Expected %s=%s but got %s=%s for service %+v node %+v",
data.label[0], data.label[1], data.label[0], node.Metadata[data.label[0]], service, node)
}
seen = true