(b *testing.B)
| 376 | } |
| 377 | |
| 378 | func BenchmarkGzip(b *testing.B) { |
| 379 | e := echo.New() |
| 380 | |
| 381 | req := httptest.NewRequest(http.MethodGet, "/", nil) |
| 382 | req.Header.Set(echo.HeaderAcceptEncoding, gzipScheme) |
| 383 | |
| 384 | h := Gzip()(func(c *echo.Context) error { |
| 385 | c.Response().Write([]byte("test")) // For Content-Type sniffing |
| 386 | return nil |
| 387 | }) |
| 388 | |
| 389 | b.ReportAllocs() |
| 390 | b.ResetTimer() |
| 391 | |
| 392 | for i := 0; i < b.N; i++ { |
| 393 | // Gzip |
| 394 | rec := httptest.NewRecorder() |
| 395 | c := e.NewContext(req, rec) |
| 396 | h(c) |
| 397 | } |
| 398 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…