mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-26 17:46:34 +03:00
do not copy Request and Cookie objects in tests
This commit is contained in:
+6
-6
@@ -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
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user