(b *testing.B)
| 2291 | } |
| 2292 | |
| 2293 | func Benchmark_Route_Match_Star_Parallel(b *testing.B) { |
| 2294 | var match bool |
| 2295 | var params [maxParams]string |
| 2296 | parsed := parseRoute("/*", regexp.MustCompile) |
| 2297 | route := &Route{use: false, root: false, star: true, routeParser: parsed, Params: parsed.params, path: "/user/keys/bla", Path: "/user/keys/bla", Method: "DELETE"} |
| 2298 | route.Handlers = append(route.Handlers, func(_ Ctx) error { |
| 2299 | return nil |
| 2300 | }) |
| 2301 | b.RunParallel(func(pb *testing.PB) { |
| 2302 | for pb.Next() { |
| 2303 | match = route.match("/user/keys/bla", "/user/keys/bla", ¶ms) |
| 2304 | } |
| 2305 | }) |
| 2306 | require.True(b, match) |
| 2307 | require.Equal(b, []string{"user/keys/bla"}, params[0:len(parsed.params)]) |
| 2308 | } |
| 2309 | |
| 2310 | func Benchmark_Route_Match_Root_Parallel(b *testing.B) { |
| 2311 | var match bool |
nothing calls this directly
no test coverage detected