aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/strings
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-12-12 23:13:29 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-12-12 23:13:29 +0000
commita42a906c420d7bb196cb8541e0ab65264a0b04b0 (patch)
tree8c441679e35147b1e9bec048f733fc394fb0c161 /libgo/go/strings
parentbc77608b97abcc4bb3171f08a71e34ae342e9f8d (diff)
downloadgcc-a42a906c420d7bb196cb8541e0ab65264a0b04b0.zip
gcc-a42a906c420d7bb196cb8541e0ab65264a0b04b0.tar.gz
gcc-a42a906c420d7bb196cb8541e0ab65264a0b04b0.tar.bz2
libgo: Update to current master library sources.
From-SVN: r194460
Diffstat (limited to 'libgo/go/strings')
-rw-r--r--libgo/go/strings/reader.go2
-rw-r--r--libgo/go/strings/reader_test.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/libgo/go/strings/reader.go b/libgo/go/strings/reader.go
index 98325ce..11240ef 100644
--- a/libgo/go/strings/reader.go
+++ b/libgo/go/strings/reader.go
@@ -124,7 +124,7 @@ func (r *Reader) Seek(offset int64, whence int) (int64, error) {
func (r *Reader) WriteTo(w io.Writer) (n int64, err error) {
r.prevRune = -1
if r.i >= len(r.s) {
- return 0, io.EOF
+ return 0, nil
}
s := r.s[r.i:]
m, err := io.WriteString(w, s)
diff --git a/libgo/go/strings/reader_test.go b/libgo/go/strings/reader_test.go
index bab91fc..4fdddcd 100644
--- a/libgo/go/strings/reader_test.go
+++ b/libgo/go/strings/reader_test.go
@@ -90,7 +90,7 @@ func TestReaderAt(t *testing.T) {
func TestWriteTo(t *testing.T) {
const str = "0123456789"
- for i := 0; i < len(str); i++ {
+ for i := 0; i <= len(str); i++ {
s := str[i:]
r := strings.NewReader(s)
var b bytes.Buffer
@@ -99,7 +99,7 @@ func TestWriteTo(t *testing.T) {
t.Errorf("got %v; want %v", n, expect)
}
if err != nil {
- t.Errorf("got error = %v; want nil", err)
+ t.Errorf("for length %d: got error = %v; want nil", len(s), err)
}
if b.String() != s {
t.Errorf("got string %q; want %q", b.String(), s)