diff --git a/src/pkg/exp/html/parse_test.go b/src/pkg/exp/html/parse_test.go index 2e8dfbf107..e3c69b6f5b 100644 --- a/src/pkg/exp/html/parse_test.go +++ b/src/pkg/exp/html/parse_test.go @@ -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. diff --git a/src/pkg/exp/html/testlogs/tests16.dat.log b/src/pkg/exp/html/testlogs/tests16.dat.log index 4f1e211962..23e2789eea 100644 --- a/src/pkg/exp/html/testlogs/tests16.dat.log +++ b/src/pkg/exp/html/testlogs/tests16.dat.log @@ -186,6 +186,6 @@ PASS "-->" PASS "" PASS "<!--<xmp>-->" PASS "<!--<noembed>-->" -FAIL "" +PASS "
\n" PASS "
" PARSE "
" diff --git a/src/pkg/exp/html/testlogs/tests26.dat.log b/src/pkg/exp/html/testlogs/tests26.dat.log index 17c6ae82cb..fa97b44cd1 100644 --- a/src/pkg/exp/html/testlogs/tests26.dat.log +++ b/src/pkg/exp/html/testlogs/tests26.dat.log @@ -7,7 +7,7 @@ PASS "1
23" PASS "1" PASS "12" PASS "12" -FAIL "

" +PASS "

\n" PASS "

a" PASS "

a" PASS "

a"