Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for TestReaderReset (0.09 sec)

  1. src/bytes/reader_test.go

    	io.CopyN(io.Discard, r, 1)
    	if r.Len() != 2 {
    		t.Errorf("Len = %d; want 2", r.Len())
    	}
    	if r.Size() != 3 {
    		t.Errorf("Size = %d; want 3", r.Size())
    	}
    }
    
    func TestReaderReset(t *testing.T) {
    	r := NewReader([]byte("世界"))
    	if _, _, err := r.ReadRune(); err != nil {
    		t.Errorf("ReadRune: unexpected error: %v", err)
    	}
    
    	const want = "abcdef"
    	r.Reset([]byte(want))
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 8K bytes
    - Viewed (0)
  2. src/bufio/bufio_test.go

    				}
    				t.Logf("read(%d) = %q, %v", len(p), string(p[:n]), err)
    			}
    			want("abc", nil)
    			want("", nil)
    			want("def", nil)
    			want("", io.EOF)
    		})
    	}
    }
    
    func TestReaderReset(t *testing.T) {
    	checkAll := func(r *Reader, want string) {
    		t.Helper()
    		all, err := io.ReadAll(r)
    		if err != nil {
    			t.Fatal(err)
    		}
    		if string(all) != want {
    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