bufio: fix indexes in TestWriter

Change-Id: I393c53d6f7b526d156226502544725a4cb9fb118
GitHub-Last-Rev: 5d53406c70
GitHub-Pull-Request: golang/go#28693
Reviewed-on: https://go-review.googlesource.com/c/148818
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Ryan Dahl 2018-11-09 18:13:52 +00:00 committed by Brad Fitzpatrick
parent 2b534f28ce
commit 410d63dbe9
1 changed files with 1 additions and 1 deletions

View File

@ -550,7 +550,7 @@ func TestWriter(t *testing.T) {
t.Errorf("%s: %d bytes written", context, len(written)) t.Errorf("%s: %d bytes written", context, len(written))
} }
for l := 0; l < len(written); l++ { for l := 0; l < len(written); l++ {
if written[i] != data[i] { if written[l] != data[l] {
t.Errorf("wrong bytes written") t.Errorf("wrong bytes written")
t.Errorf("want=%q", data[0:len(written)]) t.Errorf("want=%q", data[0:len(written)])
t.Errorf("have=%q", written) t.Errorf("have=%q", written)