Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestNoUnreadByteAfterPeek (0.2 sec)

  1. src/bufio/bufio_test.go

    	br := NewReader(strings.NewReader("example"))
    	br.ReadRune()
    	br.Peek(1)
    	if err := br.UnreadRune(); err == nil {
    		t.Error("UnreadRune didn't fail after Peek")
    	}
    }
    
    func TestNoUnreadByteAfterPeek(t *testing.T) {
    	br := NewReader(strings.NewReader("example"))
    	br.ReadByte()
    	br.Peek(1)
    	if err := br.UnreadByte(); err == nil {
    		t.Error("UnreadByte didn't fail after Peek")
    	}
    }
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Feb 10 18:56:01 GMT 2023
    - 51.5K bytes
    - Viewed (0)
Back to top