(b *testing.B)
| 51 | } |
| 52 | |
| 53 | func BenchmarkFlateReader(b *testing.B) { |
| 54 | b.ReportAllocs() |
| 55 | |
| 56 | var buf bytes.Buffer |
| 57 | w, _ := flate.NewWriter(&buf, flate.BestSpeed) |
| 58 | w.Write([]byte{'a'}) |
| 59 | w.Flush() |
| 60 | |
| 61 | for i := 0; i < b.N; i++ { |
| 62 | r := flate.NewReader(bytes.NewReader(buf.Bytes())) |
| 63 | io.ReadAll(r) |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | // TestWriteSingleFrameCompressed verifies that Conn.Write sends compressed |
| 68 | // messages in a single frame instead of multiple frames, and that messages |
nothing calls this directly
no test coverage detected
searching dependent graphs…