MCPcopy Create free account
hub / github.com/PuerkitoBio/goquery / TestFilterFunction

Function TestFilterFunction

filter_test.go:28–33  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26}
27
28func TestFilterFunction(t *testing.T) {
29 sel := Doc().Find(".pvk-content").FilterFunction(func(i int, s *Selection) bool {
30 return i > 0
31 })
32 assertLength(t, sel.Nodes, 2)
33}
34
35func TestFilterFunctionRollback(t *testing.T) {
36 sel := Doc().Find(".pvk-content")

Callers

nothing calls this directly

Calls 4

DocFunction · 0.85
assertLengthFunction · 0.85
FilterFunctionMethod · 0.80
FindMethod · 0.80

Tested by

no test coverage detected