Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestMultiReaderCopy (0.63 sec)

  1. src/io/multi_test.go

    	if n != 50 || err != ErrShortWrite {
    		t.Errorf("Write = %d, %v, want 50, ErrShortWrite", n, err)
    	}
    }
    
    // Test that MultiReader copies the input slice and is insulated from future modification.
    func TestMultiReaderCopy(t *testing.T) {
    	slice := []Reader{strings.NewReader("hello world")}
    	r := MultiReader(slice...)
    	slice[0] = nil
    	data, err := ReadAll(r)
    	if err != nil || string(data) != "hello world" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 06 15:49:32 UTC 2022
    - 10K bytes
    - Viewed (0)
Back to top