From 19cbb1461ca04a8eb64f0c4f354d8fb81a70d4f3 Mon Sep 17 00:00:00 2001 From: Tao Qingyun Date: Tue, 13 Oct 2020 13:54:17 +0800 Subject: [PATCH] io: add ErrBadWriteCount Change-Id: I04aebbaeb504f3b856b351bb924b1bce9a015083 --- src/io/io_test.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/io/io_test.go b/src/io/io_test.go index f3476610ba7..a8399bcac60 100644 --- a/src/io/io_test.go +++ b/src/io/io_test.go @@ -431,7 +431,7 @@ func TestSectionReader_Size(t *testing.T) { } // largeWriter returns an invalid count that is larger than the number -// of bytes requested (issue 39978). +// of bytes provided (issue 39978). type largeWriter struct { err error } @@ -446,16 +446,14 @@ func TestCopyLargeWriter(t *testing.T) { wb := largeWriter{} rb.WriteString("hello, world.") if _, err := Copy(wb, rb); err != want { - t.Errorf("Copy Error: got %v, want %v", err, want) + t.Errorf("Copy error: got %v, want %v", err, want) } -} -func TestCopyLargeWriterError(t *testing.T) { - want := errors.New("largerWriteError") - rb := new(Buffer) - wb := largeWriter{err: want} + want = errors.New("largeWriterError") + rb = new(Buffer) + wb = largeWriter{err: want} rb.WriteString("hello, world.") if _, err := Copy(wb, rb); err != want { - t.Errorf("Copy Error: got %v, want %v", err, want) + t.Errorf("Copy error: got %v, want %v", err, want) } }