- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for ReadRune (0.11 sec)
-
src/bufio/bufio_test.go
} } func TestUnreadRuneAtEOF(t *testing.T) { // UnreadRune/ReadRune should error at EOF (was a bug; used to panic) r := NewReader(strings.NewReader("x")) r.ReadRune() r.ReadRune() r.UnreadRune() _, _, err := r.ReadRune() if err == nil { t.Error("expected error at EOF") } else if err != io.EOF { t.Error("expected EOF; got", 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) -
src/bytes/buffer.go
c := b.buf[b.off] b.off++ b.lastRead = opRead return c, nil } // ReadRune reads and returns the next UTF-8-encoded // Unicode code point from the buffer. // If no bytes are available, the error returned is io.EOF. // If the bytes are an erroneous UTF-8 encoding, it // consumes one byte and returns U+FFFD, 1. func (b *Buffer) ReadRune() (r rune, size int, err error) { if b.empty() {
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Tue Oct 29 16:47:05 UTC 2024 - 15.7K bytes - Viewed (0) -
src/bytes/buffer_test.go
t.Fatal("UnreadRune at EOF: got no error") } if _, _, err := buf.ReadRune(); err == nil { t.Fatal("ReadRune at EOF: got no error") } if err := buf.UnreadRune(); err == nil { t.Fatal("UnreadRune after ReadRune at EOF: got no error") } // check not at EOF buf.Write(b) for r := rune(0); r < NRune; r++ { r1, size, _ := buf.ReadRune() if err := buf.UnreadRune(); err != nil {
Registered: Tue Nov 05 11:13:11 UTC 2024 - Last Modified: Tue Sep 03 20:55:15 UTC 2024 - 18.6K bytes - Viewed (0)