Skip to content

Commit ac0b9cf

Browse files
committed
Simpler test
1 parent 3cbdcf1 commit ac0b9cf

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

html/iter_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ func TestNode_Children(t *testing.T) {
1616
in string
1717
want string
1818
}{
19-
{"<a></a>", ""},
20-
{"<a><b></b></a>", "b"},
21-
{"<a>b</a>", "b"},
22-
{"<a><!--b--></a>", "b"},
23-
{"<a>b<c></c>d</a>", "b c d"},
24-
{"<a>b<c><!--d--></c>e</a>", "b c e"},
25-
{"<a><b><c>d<!--e-->f</c></b>g<!--h--><i>j</i></a>", "b g h i"},
19+
{"", ""},
20+
{"<a></a>", "a"},
21+
{"a", "a"},
22+
{"<a></a><!--b-->", "a b"},
23+
{"a<b></b>c", "a b c"},
24+
{"a<b><!--c--></b>d", "a b d"},
25+
{"<a><b>c<!--d-->e</b></a>f<!--g--><h>i</h>", "a f g h"},
2626
}
2727
for _, test := range tests {
2828
doc, err := Parse(strings.NewReader(test.in))
2929
if err != nil {
3030
t.Fatal(err)
3131
}
32-
// Drill to <html><head></head><body><a>
33-
n := doc.FirstChild.FirstChild.NextSibling.FirstChild
32+
// Drill to <html><head></head><body>
33+
n := doc.FirstChild.FirstChild.NextSibling
3434
var results []string
3535
for c := range n.Children() {
3636
results = append(results, c.Data)

0 commit comments

Comments
 (0)