add benchmarks

This commit is contained in:
Patricio Whittingslow
2026-07-25 22:18:19 -03:00
parent 6e332e7833
commit 99f848f93f
3 changed files with 94 additions and 4 deletions
+3 -2
View File
@@ -50,9 +50,10 @@ func TestExchangeWriteHeader(t *testing.T) {
// Longest status text in status.go: worst case for the status line buffer.
{code: 511, want: "HTTP/1.1 511 Network Authentication Required\r\n\r\n"},
} {
exch := newExchange(t, newConn(""), 128, false)
conn := newConn("")
exch := newExchange(t, conn, 128, false)
exch.WriteHeader(test.code)
if got := exch.rw.(*rwconn).ViewWritten(); got != test.want {
if got := conn.ViewWritten(); got != test.want {
t.Errorf("code %d: want %q, got %q", test.code, test.want, got)
}
}