]> Cypherpunks repositories - gostls13.git/commitdiff
image/png: fix compare-to-golden-file test.
authorNigel Tao <nigeltao@golang.org>
Fri, 13 Jun 2014 07:43:02 +0000 (17:43 +1000)
committerNigel Tao <nigeltao@golang.org>
Fri, 13 Jun 2014 07:43:02 +0000 (17:43 +1000)
bufio.Scanner.Scan returns whether the scan succeeded, not whether it
is done, so the test was mistakenly breaking early.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/93670045

src/pkg/image/png/reader_test.go

index ac0d949a9d3905eff785db46c2af683a3c1a63d7..0bc3c8d4a18d4ef86ce49679233fa9681d27dcd0 100644 (file)
@@ -235,8 +235,8 @@ func TestReader(t *testing.T) {
 
                // Compare the two, in SNG format, line by line.
                for {
-                       pdone := pb.Scan()
-                       sdone := sb.Scan()
+                       pdone := !pb.Scan()
+                       sdone := !sb.Scan()
                        if pdone && sdone {
                                break
                        }