]> Cypherpunks repositories - gostls13.git/commitdiff
all: fix a few more printf arg bugs found by go vet
authorRob Pike <r@golang.org>
Thu, 28 Feb 2013 19:33:08 +0000 (11:33 -0800)
committerRob Pike <r@golang.org>
Thu, 28 Feb 2013 19:33:08 +0000 (11:33 -0800)
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7413045

src/pkg/math/big/rat_test.go
src/pkg/reflect/set_test.go
src/pkg/strings/strings_test.go

index b7456b1e2a87e00bb37b477f62b99d8c7d3e920b..462dfb723d1f45399c8cafaa1187dbfcebf594f2 100644 (file)
@@ -753,7 +753,7 @@ func TestFloat64SpecialCases(t *testing.T) {
 
                // 4. Check exactness using slow algorithm.
                if wasExact := new(Rat).SetFloat64(f).Cmp(r) == 0; wasExact != exact {
-                       t.Errorf("Rat.SetString(%q).Float64().exact = %b, want %b", input, exact, wasExact)
+                       t.Errorf("Rat.SetString(%q).Float64().exact = %t, want %t", input, exact, wasExact)
                }
        }
 }
index 83b6507f1a1da268beaae5baf800be0f93ecce22..85dc55e68123185f20fc13b31e1e5bb76fb8e599 100644 (file)
@@ -81,7 +81,7 @@ func TestImplicitMapConversion(t *testing.T) {
                        t.Errorf("#5 after SetMapIndex(b1, b2): %p (!= %p), %t (map=%v)", x, b2, ok, m)
                }
                if p := mv.MapIndex(ValueOf(b1)).Elem().Pointer(); p != uintptr(unsafe.Pointer(b2)) {
-                       t.Errorf("#5 MapIndex(b1) = %p want %p", p, b2)
+                       t.Errorf("#5 MapIndex(b1) = %#x want %p", p, b2)
                }
        }
        {
@@ -96,7 +96,7 @@ func TestImplicitMapConversion(t *testing.T) {
                        t.Errorf("#6 after SetMapIndex(c1, c2): %p (!= %p), %t (map=%v)", x, c2, ok, m)
                }
                if p := mv.MapIndex(ValueOf(c1)).Pointer(); p != ValueOf(c2).Pointer() {
-                       t.Errorf("#6 MapIndex(c1) = %p want %p", p, c2)
+                       t.Errorf("#6 MapIndex(c1) = %#x want %p", p, c2)
                }
        }
        {
@@ -115,7 +115,7 @@ func TestImplicitMapConversion(t *testing.T) {
                        t.Errorf("#7 after SetMapIndex(b1, b2): %p (!= %p), %t (map=%v)", x, b2, ok, m)
                }
                if p := mv.MapIndex(ValueOf(b1)).Pointer(); p != uintptr(unsafe.Pointer(b2)) {
-                       t.Errorf("#7 MapIndex(b1) = %p want %p", p, b2)
+                       t.Errorf("#7 MapIndex(b1) = %#x want %p", p, b2)
                }
        }
 
index 2db9e3d1f34b68501b9083496d1a429acccb853d..09de49e5fbc73fc70d73643c0846b2ead8a99f66 100644 (file)
@@ -967,7 +967,7 @@ var ContainsRuneTests = []struct {
 func TestContainsRune(t *testing.T) {
        for _, ct := range ContainsRuneTests {
                if ContainsRune(ct.str, ct.r) != ct.expected {
-                       t.Errorf("ContainsRune(%s, %s) = %v, want %v",
+                       t.Errorf("ContainsRune(%q, %q) = %v, want %v",
                                ct.str, ct.r, !ct.expected, ct.expected)
                }
        }