MCPcopy
hub / github.com/PuerkitoBio/goquery / TestIsFunction

Function TestIsFunction

query_test.go:35–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestIsFunction(t *testing.T) {
36 ok := Doc().Find("div").IsFunction(func(i int, s *Selection) bool {
37 return s.HasClass("container-fluid")
38 })
39
40 if !ok {
41 t.Error("Expected some div to have a container-fluid class.")
42 }
43}
44
45func TestIsFunctionRollback(t *testing.T) {
46 ok := Doc().Find("div").IsFunction(func(i int, s *Selection) bool {

Callers

nothing calls this directly

Calls 4

DocFunction · 0.85
IsFunctionMethod · 0.80
FindMethod · 0.80
HasClassMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…