(b *testing.B)
| 2127 | } |
| 2128 | |
| 2129 | func Benchmark_Router_NotFound_Parallel(b *testing.B) { |
| 2130 | b.ReportAllocs() |
| 2131 | app := New() |
| 2132 | app.Use(func(c Ctx) error { |
| 2133 | return c.Next() |
| 2134 | }) |
| 2135 | registerDummyRoutes(app) |
| 2136 | appHandler := app.Handler() |
| 2137 | c := &fasthttp.RequestCtx{} |
| 2138 | c.Request.Header.SetMethod("DELETE") |
| 2139 | c.URI().SetPath("/this/route/does/not/exist") |
| 2140 | b.RunParallel(func(pb *testing.PB) { |
| 2141 | for pb.Next() { |
| 2142 | appHandler(c) |
| 2143 | } |
| 2144 | }) |
| 2145 | require.Equal(b, 404, c.Response.StatusCode()) |
| 2146 | require.Equal(b, "Not Found", string(c.Response.Body())) |
| 2147 | } |
| 2148 | |
| 2149 | func Benchmark_Router_Handler_Parallel(b *testing.B) { |
| 2150 | app := New() |
nothing calls this directly
no test coverage detected