@@ -16,21 +16,21 @@ func TestNode_Children(t *testing.T) {
16
16
in string
17
17
want string
18
18
}{
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" },
26
26
}
27
27
for _ , test := range tests {
28
28
doc , err := Parse (strings .NewReader (test .in ))
29
29
if err != nil {
30
30
t .Fatal (err )
31
31
}
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
34
34
var results []string
35
35
for c := range n .Children () {
36
36
results = append (results , c .Data )
0 commit comments