summaryrefslogtreecommitdiff
path: root/libgo/go/bufio/bufio_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/bufio/bufio_test.go')
-rw-r--r--libgo/go/bufio/bufio_test.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/libgo/go/bufio/bufio_test.go b/libgo/go/bufio/bufio_test.go
index 0285deeb3d1..1f893951c15 100644
--- a/libgo/go/bufio/bufio_test.go
+++ b/libgo/go/bufio/bufio_test.go
@@ -14,7 +14,7 @@ import (
"strings"
"testing"
"testing/iotest"
- "utf8"
+ "unicode/utf8"
)
// Reads from a reader and rot13s the result.
@@ -698,6 +698,17 @@ func TestLinesAfterRead(t *testing.T) {
}
}
+func TestReadLineNonNilLineOrError(t *testing.T) {
+ r := NewReader(strings.NewReader("line 1\n"))
+ for i := 0; i < 2; i++ {
+ l, _, err := r.ReadLine()
+ if l != nil && err != nil {
+ t.Fatalf("on line %d/2; ReadLine=%#v, %v; want non-nil line or Error, but not both",
+ i+1, l, err)
+ }
+ }
+}
+
type readLineResult struct {
line []byte
isPrefix bool