do not copy Request and Cookie objects in tests

This commit is contained in:
Aliaksandr Valialkin
2016-03-28 17:17:05 +03:00
parent 0d8bc2c01a
commit bfa17b7ae9
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -967,7 +967,7 @@ func TestResponseHeaderCookie(t *testing.T) {
expectedC1.SetKey("foobar")
expectedC1.SetValue("aaa")
if !equalCookie(&expectedC1, &c) {
t.Fatalf("unexpected cookie\n%#v\nExpected\n%#v\n", c, expectedC1)
t.Fatalf("unexpected cookie\n%#v\nExpected\n%#v\n", &c, &expectedC1)
}
c.SetKey("йцук")
@@ -980,7 +980,7 @@ func TestResponseHeaderCookie(t *testing.T) {
expectedC2.SetValue("aaa")
expectedC2.SetDomain("foobar.com")
if !equalCookie(&expectedC2, &c) {
t.Fatalf("unexpected cookie\n%v\nExpected\n%v\n", c, expectedC2)
t.Fatalf("unexpected cookie\n%v\nExpected\n%v\n", &c, &expectedC2)
}
h.VisitAllCookie(func(key, value []byte) {
@@ -992,11 +992,11 @@ func TestResponseHeaderCookie(t *testing.T) {
switch {
case bytes.Equal(key, []byte("foobar")):
if !equalCookie(&expectedC1, &cc) {
t.Fatalf("unexpected cookie\n%v\nExpected\n%v\n", cc, expectedC1)
t.Fatalf("unexpected cookie\n%v\nExpected\n%v\n", &cc, &expectedC1)
}
case bytes.Equal(key, []byte("йцук")):
if !equalCookie(&expectedC2, &cc) {
t.Fatalf("unexpected cookie\n%v\nExpected\n%v\n", cc, expectedC2)
t.Fatalf("unexpected cookie\n%v\nExpected\n%v\n", &cc, &expectedC2)
}
default:
t.Fatalf("unexpected cookie key %q", key)
@@ -1023,7 +1023,7 @@ func TestResponseHeaderCookie(t *testing.T) {
t.Fatalf("Cannot find cookie %q", c.Key())
}
if !equalCookie(&expectedC1, &c) {
t.Fatalf("unexpected cookie\n%v\nExpected\n%v\n", c, expectedC1)
t.Fatalf("unexpected cookie\n%v\nExpected\n%v\n", &c, &expectedC1)
}
c.SetKey("йцук")
@@ -1031,7 +1031,7 @@ func TestResponseHeaderCookie(t *testing.T) {
t.Fatalf("cannot find cookie %q", c.Key())
}
if !equalCookie(&expectedC2, &c) {
t.Fatalf("unexpected cookie\n%v\nExpected\n%v\n", c, expectedC2)
t.Fatalf("unexpected cookie\n%v\nExpected\n%v\n", &c, &expectedC2)
}
}
+1 -1
View File
@@ -1100,7 +1100,7 @@ func testRequestWriteError(t *testing.T, method, requestURI, host, userAgent, bo
bw := bufio.NewWriter(w)
err := req.Write(bw)
if err == nil {
t.Fatalf("Expecting error when writing request=%#v", req)
t.Fatalf("Expecting error when writing request=%#v", &req)
}
}