Commit 2f39a33b authored by Andrew Balholm's avatar Andrew Balholm Committed by Nigel Tao

exp/html: in parse tests, discard only one trailing newline

Pass 2 additional tests.

R=nigeltao
CC=golang-dev
https://golang.org/cl/6454090
parent 1916db78
......@@ -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.
......
......@@ -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>"
......@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment