Home | History | Annotate | Download | only in io

Lines Matching refs:Read

28 // Test a single read/write pair.
34 n, err := r.Read(buf)
36 t.Errorf("read: %v", err)
38 t.Errorf("bad read: got %q", buf[0:n])
48 n, err := r.Read(buf)
54 t.Errorf("read: %v", err)
60 // Test a sequence of read/write pairs.
77 t.Errorf("wrote %d, read got %d", n, nn)
83 t.Errorf("final read got %d", nn)
110 nn, err := r.Read(rdat[tot : tot+n])
112 t.Fatalf("read: %v", err)
122 t.Fatalf("read at end: %v", err)
126 t.Fatalf("read %d, expected %d, got %d", n, expect, nn)
135 t.Fatalf("total read %d != 128", tot)
144 // Test read after/before writer close.
194 n, err := r.Read(buf)
201 t.Errorf("read from closed pipe: %v want %v", err, want)
204 t.Errorf("read on closed pipe returned %d", n)
212 // Test close on Read side during Read.
217 n, err := r.Read(make([]byte, 64))
220 t.Errorf("read from closed pipe: %v, %v want %v, %v", n, err, 0, ErrClosedPipe)
335 if _, err := r.Read(nil); err != (testError1{}) {
336 t.Errorf("Read error: got %T, want testError1", err)
339 if _, err := r.Read(nil); err != (testError2{}) {
340 t.Errorf("Read error: got %T, want testError2", err)
365 if n, err := r.Read(buf[i : i+readSize]); n != readSize || err != nil {
366 t.Errorf("Read() = (%d, %v); want (%d, nil)", n, err, readSize)
370 // Since each Write is fully gated, if multiple Read calls were needed,
379 t.Run("Read", func(t *testing.T) {
387 if n, err := r.Read(buf); n != readSize || err != nil {
388 t.Errorf("Read() = (%d, %v); want (%d, nil)", n, err, readSize)
400 // Since each read is independent, the only guarantee about the output