Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestReaderClearError (0.11 sec)

  1. src/bufio/bufio_test.go

    }
    
    func (r *errorThenGoodReader) Read(p []byte) (int, error) {
    	r.nread++
    	if !r.didErr {
    		r.didErr = true
    		return 0, errFake
    	}
    	return len(p), nil
    }
    
    func TestReaderClearError(t *testing.T) {
    	r := &errorThenGoodReader{}
    	b := NewReader(r)
    	buf := make([]byte, 1)
    	if _, err := b.Read(nil); err != nil {
    		t.Fatalf("1st nil Read = %v; want nil", err)
    	}
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Nov 01 21:52:12 UTC 2024
    - 51.6K bytes
    - Viewed (0)
Back to top