(p []byte)
| 16 | } |
| 17 | |
| 18 | func (fk *fakeReader) Read(p []byte) (int, error) { |
| 19 | q, ok := <-fk.p |
| 20 | if !ok { |
| 21 | if fk.err == nil { |
| 22 | return 0, io.EOF |
| 23 | } |
| 24 | return 0, fk.err |
| 25 | } |
| 26 | if len(q) > len(p) { |
| 27 | panic(io.ErrShortBuffer) |
| 28 | } |
| 29 | return copy(p, q), nil |
| 30 | } |
| 31 | |
| 32 | func TestFrameReader(t *testing.T) { |
| 33 | const timeout = 100 * time.Millisecond |
nothing calls this directly
no outgoing calls
no test coverage detected