(t *testing.T)
| 3 | import "testing" |
| 4 | |
| 5 | func TestMemoryReader_Header(t *testing.T) { |
| 6 | item := &MemoryItem{ |
| 7 | ExpiresAt: 0, |
| 8 | HeaderValue: []byte("0123456789"), |
| 9 | BodyValue: nil, |
| 10 | Status: 2000, |
| 11 | } |
| 12 | reader := NewMemoryReader(item) |
| 13 | buf := make([]byte, 6) |
| 14 | err := reader.ReadHeader(buf, func(n int) (goNext bool, err error) { |
| 15 | t.Log("buf:", string(buf[:n])) |
| 16 | return true, nil |
| 17 | }) |
| 18 | if err != nil { |
| 19 | t.Fatal(err) |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | func TestMemoryReader_Body(t *testing.T) { |
| 24 | item := &MemoryItem{ |
nothing calls this directly
no test coverage detected