]> Cypherpunks repositories - gostls13.git/commitdiff
debug/elf: deflake file_test.go
authorJoe Tsai <joetsai@digital-static.net>
Wed, 30 Mar 2016 06:34:37 +0000 (23:34 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 30 Mar 2016 06:56:25 +0000 (06:56 +0000)
It is valid for io.Reader to return (n, io.EOF) where n is positive.
The unit test should not fail if io.EOF is returned when read until
the end.

Change-Id: I7b918e3cc03db8b90c8aa58f4c0f7806a1d4af7e
Reviewed-on: https://go-review.googlesource.com/21307
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/debug/elf/file_test.go

index 42caefa4cfb68d73db788968a8a07cefb3b85dda..2fe6febb26b024d9723da6b0689c0d4650664677 100644 (file)
@@ -688,7 +688,7 @@ func TestCompressedSection(t *testing.T) {
                if end > int64(len(buf)) {
                        end = int64(len(buf))
                }
-               n, err := sf.Read(buf[pos:end])
+               n, err := io.ReadFull(sf, buf[pos:end])
                if err != nil {
                        t.Fatal(err)
                }