go/src/net/http/response_test.go

type respTest

func dummyReq(method string) *Request {}

func dummyReq11(method string) *Request {}

var respTests

// tests successful calls to ReadResponse, and inspects the returned Response.
// For error cases, see TestReadResponseErrors below.
func TestReadResponse(t *testing.T) {}

func TestWriteResponse(t *testing.T) {}

var readResponseCloseInMiddleTests

type readerAndCloser

// TestReadResponseCloseInMiddle tests that closing a body after
// reading only part of its contents advances the read to the end of
// the request, right up until the next request.
func TestReadResponseCloseInMiddle(t *testing.T) {}

func diff(t *testing.T, prefix string, have, want any) {}

type responseLocationTest

var responseLocationTests

func TestLocationResponse(t *testing.T) {}

func TestResponseStatusStutter(t *testing.T) {}

func TestResponseContentLengthShortBody(t *testing.T) {}

// Test various ReadResponse error cases. (also tests success cases, but mostly
// it's about errors).  This does not test anything involving the bodies. Only
// the return value from ReadResponse itself.
func TestReadResponseErrors(t *testing.T) {}

// wantErr can be nil, an error value to match exactly, or type string to
// match a substring.
func matchErr(err error, wantErr any) error {}

// A response should only write out single Connection: close header. Tests #19499.
func TestResponseWritesOnlySingleConnectionClose(t *testing.T) {}