aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/html/parse_test.go
diff options
context:
space:
mode:
authorNigel Tao <nigeltao@golang.org>2011-07-21 11:20:54 +1000
committerNigel Tao <nigeltao@golang.org>2011-07-21 11:20:54 +1000
commit5a141064ed3a699ec1c6060c77e4ff1ca3faf85b (patch)
treea0ffdc2069b070fd166bb09b02472f587c1a14a3 /src/pkg/html/parse_test.go
parentd11c0f1dbb00afca09c48a2566ea30c9b2516e10 (diff)
downloadgo-5a141064ed3a699ec1c6060c77e4ff1ca3faf85b.tar.xz
html: parse misnested formatting tags according to the HTML5 spec.
This is the "adoption agency" algorithm. The test case input is "<a><p>X<a>Y</a>Z</p></a>". The correct parse is: | <html> | <head> | <body> | <a> | <p> | <a> | "X" | <a> | "Y" | "Z" R=gri CC=golang-dev https://golang.org/cl/4771042
Diffstat (limited to 'src/pkg/html/parse_test.go')
-rw-r--r--src/pkg/html/parse_test.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pkg/html/parse_test.go b/src/pkg/html/parse_test.go
index 3fa35d5dbe..f22fa277bc 100644
--- a/src/pkg/html/parse_test.go
+++ b/src/pkg/html/parse_test.go
@@ -85,6 +85,8 @@ func dumpLevel(w io.Writer, n *Node, level int) os.Error {
fmt.Fprintf(w, "%q", EscapeString(n.Data))
case CommentNode:
return os.NewError("COMMENT")
+ case scopeMarkerNode:
+ return os.NewError("unexpected scopeMarkerNode")
default:
return os.NewError("unknown node type")
}
@@ -119,7 +121,7 @@ func TestParser(t *testing.T) {
rc := make(chan io.Reader)
go readDat(filename, rc)
// TODO(nigeltao): Process all test cases, not just a subset.
- for i := 0; i < 22; i++ {
+ for i := 0; i < 23; i++ {
// Parse the #data section.
b, err := ioutil.ReadAll(<-rc)
if err != nil {