(b *testing.B)
| 241 | } |
| 242 | |
| 243 | func Benchmark_Headers(b *testing.B) { |
| 244 | server := startTestServer( |
| 245 | b, |
| 246 | func(app *fiber.App) { |
| 247 | app.Get("/", func(c fiber.Ctx) error { |
| 248 | c.Response().Header.Add("foo", "bar") |
| 249 | c.Response().Header.Add("foo", "bar2") |
| 250 | c.Response().Header.Add("foo", "bar3") |
| 251 | |
| 252 | c.Response().Header.Add("foo2", "bar") |
| 253 | c.Response().Header.Add("foo2", "bar2") |
| 254 | c.Response().Header.Add("foo2", "bar3") |
| 255 | |
| 256 | return c.SendString("helo world") |
| 257 | }) |
| 258 | }, |
| 259 | ) |
| 260 | |
| 261 | client := New().SetDial(server.dial()) |
| 262 | |
| 263 | resp, err := AcquireRequest(). |
| 264 | SetClient(client). |
| 265 | Get("http://example.com") |
| 266 | require.NoError(b, err) |
| 267 | |
| 268 | b.Cleanup(func() { |
| 269 | resp.Close() |
| 270 | server.stop() |
| 271 | }) |
| 272 | |
| 273 | b.ReportAllocs() |
| 274 | |
| 275 | for b.Loop() { |
| 276 | for k, v := range resp.Headers() { |
| 277 | _ = k |
| 278 | _ = v |
| 279 | } |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | func Test_Response_Cookie(t *testing.T) { |
| 284 | t.Parallel() |
nothing calls this directly
no test coverage detected