]> Cypherpunks repositories - gostls13.git/commitdiff
exp/html: in parse tests, discard only one trailing newline
authorAndrew Balholm <andybalholm@gmail.com>
Thu, 2 Aug 2012 23:31:45 +0000 (09:31 +1000)
committerNigel Tao <nigeltao@golang.org>
Thu, 2 Aug 2012 23:31:45 +0000 (09:31 +1000)
Pass 2 additional tests.

R=nigeltao
CC=golang-dev
https://golang.org/cl/6454090

src/pkg/exp/html/parse_test.go
src/pkg/exp/html/testlogs/tests16.dat.log
src/pkg/exp/html/testlogs/tests26.dat.log

index 2e8dfbf1072fe1436a4fe3d3b60322d81057c78f..e3c69b6f5ba64bf5c61d261ccf2e7baf92c80135 100644 (file)
@@ -45,7 +45,10 @@ func readParseTest(r *bufio.Reader) (text, want, context string, err error) {
                }
                b = append(b, line...)
        }
-       text = strings.TrimRight(string(b), "\n")
+       text = string(b)
+       if strings.HasSuffix(text, "\n") {
+               text = text[:len(text)-1]
+       }
        b = b[:0]
 
        // Skip the error list.
index 4f1e2119620e33f9bedf958257c8bbbaed52a450..23e2789eeadf3c7f0da806176e57b285837235a4 100644 (file)
@@ -186,6 +186,6 @@ PASS "<iframe><!--<iframe></iframe>--></iframe>"
 PASS "<iframe>...<!--X->...<!--/X->...</iframe>"
 PASS "<xmp><!--<xmp></xmp>--></xmp>"
 PASS "<noembed><!--<noembed></noembed>--></noembed>"
-FAIL "<!doctype html><table>"
+PASS "<!doctype html><table>\n"
 PASS "<!doctype html><table><td><span><font></span><span>"
 PARSE "<!doctype html><form><table></form><form></table></form>"
index 17c6ae82cb5df83c43f34542f80238841c007cf0..fa97b44cd1471dfeabc887cf41e431b07781d157 100644 (file)
@@ -7,7 +7,7 @@ PASS "<!DOCTYPE html><body><b><nobr>1<nobr></b><div><i><nobr>2<nobr></i>3"
 PASS "<!DOCTYPE html><body><b><nobr>1<nobr><ins></b><i><nobr>"
 PASS "<!DOCTYPE html><body><b><nobr>1<ins><nobr></b><i>2"
 PASS "<!DOCTYPE html><body><b>1<nobr></b><i><nobr>2</i>"
-FAIL "<p><code x</code></p>"
+PASS "<p><code x</code></p>\n"
 PASS "<!DOCTYPE html><svg><foreignObject><p><i></p>a"
 PASS "<!DOCTYPE html><table><tr><td><svg><foreignObject><p><i></p>a"
 PASS "<!DOCTYPE html><math><mtext><p><i></p>a"