Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for TestWriteError (0.24 sec)

  1. staging/src/k8s.io/apiserver/pkg/util/flushwriter/writer_test.go

    			t.Errorf("Unexpected error while writing with flush writer: %v", err)
    		}
    	}
    	if w.writeCount != 10 {
    		t.Errorf("Write not called the expected number of times. Actual: %d", w.writeCount)
    	}
    }
    
    func TestWriteError(t *testing.T) {
    	e := fmt.Errorf("Error")
    	w := &writerWithFlush{err: e}
    	fw := Wrap(w)
    	_, err := fw.Write([]byte("Test write"))
    	if err != e {
    		t.Errorf("Did not get expected error. Got: %#v", err)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jan 05 16:09:42 UTC 2017
    - 2.1K bytes
    - Viewed (0)
  2. src/compress/flate/writer_test.go

    func (e *errorWriter) Write(b []byte) (int, error) {
    	if e.N <= 0 {
    		return 0, io.ErrClosedPipe
    	}
    	e.N--
    	return len(b), nil
    }
    
    // Test if errors from the underlying writer is passed upwards.
    func TestWriteError(t *testing.T) {
    	t.Parallel()
    	buf := new(bytes.Buffer)
    	n := 65536
    	if !testing.Short() {
    		n *= 4
    	}
    	for i := 0; i < n; i++ {
    		fmt.Fprintf(buf, "asdasfasf%d%dfghfgujyut%dyutyu\n", i, i, i)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 20 18:41:18 UTC 2020
    - 5.4K bytes
    - Viewed (0)
Back to top