diff options
author | Davor Kapsa <davor.kapsa@gmail.com> | 2020-01-25 14:40:10 +0100 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2020-02-21 18:36:11 +0000 |
commit | 753011ebc3228d68b7593e153f8d118f103c4748 (patch) | |
tree | 5805101cff36bc83171b83d3fc8d6b5a1fd08e1a /src/io | |
parent | 7f41a009a6d3f37c336b8e01fea90f11f996ce9a (diff) | |
download | go-753011ebc3228d68b7593e153f8d118f103c4748.tar.gz go-753011ebc3228d68b7593e153f8d118f103c4748.zip |
io: check n in testReadAtLeast
Change-Id: I53859d4d3c729cce9f73b14dc2dd8571f7e7ffb3
Reviewed-on: https://go-review.googlesource.com/c/go/+/216457
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/io')
-rw-r--r-- | src/io/io_test.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/io/io_test.go b/src/io/io_test.go index ca90403c59..170513dcc0 100644 --- a/src/io/io_test.go +++ b/src/io/io_test.go @@ -285,6 +285,9 @@ func testReadAtLeast(t *testing.T, rb ReadWriter) { if err != nil { t.Error(err) } + if n != 2 { + t.Errorf("expected to have read 2 bytes, got %v", n) + } n, err = ReadAtLeast(rb, buf, 4) if err != ErrShortBuffer { t.Errorf("expected ErrShortBuffer got %v", err) |