Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(35)

Unified Diff: src/pkg/bufio/bufio_test.go

Issue 3364041: code review 3364041: utf8: make EncodeRune's destination the first argument. (Closed)
Patch Set: code review 3364041: utf8: make EncodeRune's destination the first argument. Created 14 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/bufio/bufio.go ('k') | src/pkg/bytes/buffer.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pkg/bufio/bufio_test.go
===================================================================
--- a/src/pkg/bufio/bufio_test.go
+++ b/src/pkg/bufio/bufio_test.go
@@ -337,7 +337,7 @@
// Write the runes out using WriteRune
buf := make([]byte, utf8.UTFMax)
for rune := 0; rune < NRune; rune++ {
- size := utf8.EncodeRune(rune, buf)
+ size := utf8.EncodeRune(buf, rune)
nbytes, err := w.WriteRune(rune)
if err != nil {
t.Fatalf("WriteRune(0x%x) error: %s", rune, err)
@@ -351,7 +351,7 @@
r := NewReader(byteBuf)
// Read them back with ReadRune
for rune := 0; rune < NRune; rune++ {
- size := utf8.EncodeRune(rune, buf)
+ size := utf8.EncodeRune(buf, rune)
nr, nbytes, err := r.ReadRune()
if nr != rune || nbytes != size || err != nil {
t.Fatalf("ReadRune(0x%x) got 0x%x,%d not 0x%x,%d (err=%s)", r, nr, nbytes, r, size, err)
« no previous file with comments | « src/pkg/bufio/bufio.go ('k') | src/pkg/bytes/buffer.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b