t.Fatal("decode:", err)
}
if b1.A != b0.A {
- t.Fatal("got %d want %d", b1.A, b0.A)
+ t.Fatalf("got %d want %d", b1.A, b0.A)
}
if b1.C != nil || b1.CP != nil || b1.F != nil || b1.FPP != nil {
t.Fatal("unexpected value for chan or func")
t.Fatal("decode error:", err)
}
if *x.V != "hello" || *x.BV != "Καλημέρα" || *x.TV != "こんにちは" {
- t.Errorf("expected `hello` got %s", x.V)
+ t.Errorf("expected `hello` got %s", *x.V)
}
}
var z Int
f(&z, a.x, a.y)
if !isNormalized(&z) {
- t.Errorf("%s%v is not normalized", z, msg)
+ t.Errorf("%s%v is not normalized", msg, z)
}
if (&z).Cmp(a.z) != 0 {
t.Errorf("%s%+v\n\tgot z = %v; want %v", msg, a, &z, a.z)
testHeader.WriteSubset(&buf, nil)
})
if n > 0 {
- t.Errorf("mallocs = %d; want 0", n)
+ t.Errorf("mallocs = %g; want 0", n)
}
}
func testMissingFile(t *testing.T, req *Request) {
f, fh, err := req.FormFile("missing")
if f != nil {
- t.Errorf("FormFile file = %q, want nil", f)
+ t.Errorf("FormFile file = %v, want nil", f)
}
if fh != nil {
t.Errorf("FormFile file header = %q, want nil", fh)
got := resp.Header["Connection"]
if !reflect.DeepEqual(got, tt.expect) {
- t.Errorf("wrong Connection headers for request %q. Got %q expect %q", got, tt.expect)
+ t.Errorf("wrong Connection headers for request %q. Got %q expect %q", tt.req, got, tt.expect)
}
}
}
}
}
if out, err := tt.in.MarshalText(); string(out) != tt.out || err != nil {
- t.Errorf("IP.MarshalText(%v) = %q, %v, want %q, nil", out, err, tt.out)
+ t.Errorf("IP.MarshalText(%v) = %q, %v, want %q, nil", tt.in, out, err, tt.out)
}
}
}
}
defer c.Close()
if res := <-servec; res.err != nil || res.n != int64(len(msg)) {
- t.Fatalf("unexpected server Write: n=%d, err=%d; want n=%d, err=nil", res.n, res.err, len(msg))
+ t.Fatalf("unexpected server Write: n=%d, err=%v; want n=%d, err=nil", res.n, res.err, len(msg))
}
c.SetReadDeadline(time.Now().Add(-5 * time.Second)) // in the psat.
buf := make([]byte, len(msg)/2)
}
actual := re.ReplaceAllStringFunc(tc.input, tc.replacement)
if actual != tc.output {
- t.Errorf("%q.ReplaceFunc(%q,%q) = %q; want %q",
- tc.pattern, tc.input, tc.replacement, actual, tc.output)
+ t.Errorf("%q.ReplaceFunc(%q,fn) = %q; want %q",
+ tc.pattern, tc.input, actual, tc.output)
}
// now try bytes
actual = string(re.ReplaceAllFunc([]byte(tc.input), func(s []byte) []byte { return []byte(tc.replacement(string(s))) }))
if actual != tc.output {
- t.Errorf("%q.ReplaceFunc(%q,%q) = %q; want %q",
- tc.pattern, tc.input, tc.replacement, actual, tc.output)
+ t.Errorf("%q.ReplaceFunc(%q,fn) = %q; want %q",
+ tc.pattern, tc.input, actual, tc.output)
}
}
}
// but "{" is a shorter equivalent in some contexts.
nre, err := Parse(s, testFlags)
if err != nil {
- t.Errorf("Parse(%#q.String() = %#q): %v", tt.Regexp, t, err)
+ t.Errorf("Parse(%#q.String() = %#q): %v", tt.Regexp, s, err)
continue
}
nd := dump(nre)
func TestGoexitDeadlock(t *testing.T) {
output := executeTest(t, goexitDeadlockSource, nil)
- want := ""
if output != "" {
- t.Fatalf("expected no output:\n%s", want, output)
+ t.Fatalf("expected no output, got:\n%s", output)
}
}
t.Errorf("Expected *bigValue from interface{} in finalizer, got %v", *i)
}
if i.fill != 0xDEADBEEFDEADBEEF && i.it != true && i.up != "It matters not how strait the gate" {
- t.Errorf("*bigValue from interface{} has the wrong value: %d\n", *i)
+ t.Errorf("*bigValue from interface{} has the wrong value: %v\n", *i)
}
close(ch)
})