Skip to content

Commit

Permalink
fix ContainsNode test
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesKaufmann committed Jun 30, 2024
1 parent de4174d commit af7a9be
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion find_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ import (
)

func TestContainsNode(t *testing.T) {
node := parse(t, `<root><start><span><target></target></span><span><target></target></span></start></root><next></next>`, "root")
input := `<root><start><span><target></target></span><span><target></target></span></start></root><next></next>`
doc, err := html.Parse(strings.NewReader(input))
if err != nil {
t.Fatal(err)
}

node := FindFirstNode(doc, func(node *html.Node) bool {
return node.Data == "root"
})

var called1 int
res1 := ContainsNode(node.FirstChild, func(n *html.Node) bool {
Expand Down

0 comments on commit af7a9be

Please sign in to comment.