go test -v -run=^$ -bench=Benchmark_Ctx_Is -benchmem -count=4
(b *testing.B)
| 4001 | |
| 4002 | // go test -v -run=^$ -bench=Benchmark_Ctx_Is -benchmem -count=4 |
| 4003 | func Benchmark_Ctx_Is(b *testing.B) { |
| 4004 | app := New() |
| 4005 | c := app.AcquireCtx(&fasthttp.RequestCtx{}) |
| 4006 | |
| 4007 | c.Request().Header.Set(HeaderContentType, MIMEApplicationJSON) |
| 4008 | var res bool |
| 4009 | b.ReportAllocs() |
| 4010 | for b.Loop() { |
| 4011 | _ = c.Is(".json") |
| 4012 | res = c.Is("json") |
| 4013 | } |
| 4014 | require.True(b, res) |
| 4015 | } |
| 4016 | |
| 4017 | // go test -run Test_Ctx_Locals |
| 4018 | func Test_Ctx_Locals(t *testing.T) { |
nothing calls this directly
no test coverage detected