go test -v -run=^$ -bench=Benchmark_Ctx_Append -benchmem -count=4
(b *testing.B)
| 728 | |
| 729 | // go test -v -run=^$ -bench=Benchmark_Ctx_Append -benchmem -count=4 |
| 730 | func Benchmark_Ctx_Append(b *testing.B) { |
| 731 | app := New() |
| 732 | c := app.AcquireCtx(&fasthttp.RequestCtx{}).(*DefaultCtx) //nolint:errcheck,forcetypeassert // not needed |
| 733 | |
| 734 | b.ReportAllocs() |
| 735 | for b.Loop() { |
| 736 | c.Append("X-Custom-Header", "Hello") |
| 737 | c.Append("X-Custom-Header", "World") |
| 738 | c.Append("X-Custom-Header", "Hello") |
| 739 | } |
| 740 | require.Equal(b, "Hello, World", app.toString(c.Response().Header.Peek("X-Custom-Header"))) |
| 741 | } |
| 742 | |
| 743 | // go test -run Test_Ctx_Attachment |
| 744 | func Test_Ctx_Attachment(t *testing.T) { |
nothing calls this directly
no test coverage detected