diff options
| author | Nigel Tao <nigeltao@golang.org> | 2011-10-20 11:45:30 +1100 |
|---|---|---|
| committer | Nigel Tao <nigeltao@golang.org> | 2011-10-20 11:45:30 +1100 |
| commit | 64306c9fd076c78b4e443f641561124f103854d5 (patch) | |
| tree | f298eb61771b678494ed0e4f51d26e9e943e7e60 /src/pkg/html/parse_test.go | |
| parent | 57d07e32d82e1ea0f8edd7fba95bd192cb5f539e (diff) | |
| download | go-64306c9fd076c78b4e443f641561124f103854d5.tar.xz | |
html: parse and render comment nodes.
The first additional test case in parse_test.go is:
<!--><div>--<!-->
The second one is unrelated to the comment change, but also passes:
<p><hr></p>
R=andybalholm
CC=golang-dev
https://golang.org/cl/5299047
Diffstat (limited to 'src/pkg/html/parse_test.go')
| -rw-r--r-- | src/pkg/html/parse_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/html/parse_test.go b/src/pkg/html/parse_test.go index 564580c78b..18b70bf510 100644 --- a/src/pkg/html/parse_test.go +++ b/src/pkg/html/parse_test.go @@ -84,7 +84,7 @@ func dumpLevel(w io.Writer, n *Node, level int) os.Error { case TextNode: fmt.Fprintf(w, "%q", n.Data) case CommentNode: - return os.NewError("COMMENT") + fmt.Fprintf(w, "<!-- %s -->", n.Data) case DoctypeNode: fmt.Fprintf(w, "<!DOCTYPE %s>", n.Data) case scopeMarkerNode: @@ -123,7 +123,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 < 27; i++ { + for i := 0; i < 29; i++ { // Parse the #data section. b, err := ioutil.ReadAll(<-rc) if err != nil { |
