(t *testing.T)
| 21 | } |
| 22 | |
| 23 | func TestMemoryReader_Body(t *testing.T) { |
| 24 | item := &MemoryItem{ |
| 25 | ExpiresAt: 0, |
| 26 | HeaderValue: nil, |
| 27 | BodyValue: []byte("0123456789"), |
| 28 | Status: 2000, |
| 29 | } |
| 30 | reader := NewMemoryReader(item) |
| 31 | buf := make([]byte, 6) |
| 32 | err := reader.ReadBody(buf, func(n int) (goNext bool, err error) { |
| 33 | t.Log("buf:", string(buf[:n])) |
| 34 | return true, nil |
| 35 | }) |
| 36 | if err != nil { |
| 37 | t.Fatal(err) |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | func TestMemoryReader_Body_Range(t *testing.T) { |
| 42 | item := &MemoryItem{ |
nothing calls this directly
no test coverage detected