(b *testing.B)
| 35 | } |
| 36 | |
| 37 | func BenchmarkDecodeSSELargeStream(b *testing.B) { |
| 38 | ctx := context.Background() |
| 39 | handler := func(_ SSEEvent) error { return nil } |
| 40 | |
| 41 | b.ReportAllocs() |
| 42 | b.SetBytes(int64(len(benchmarkSSEPayload))) |
| 43 | for b.Loop() { |
| 44 | if err := decodeSSE(ctx, io.NopCloser(strings.NewReader(benchmarkSSEPayload)), handler); err != nil { |
| 45 | b.Fatalf("decodeSSE() error = %v", err) |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | func BenchmarkDoRequestPostJSON(b *testing.B) { |
| 51 | ctx := context.Background() |
nothing calls this directly
no test coverage detected