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

Function BenchmarkIsFunction

bench_query_test.go:35–50  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

33}
34
35func BenchmarkIsFunction(b *testing.B) {
36 var y bool
37
38 b.StopTimer()
39 sel := DocW().Find(".toclevel-1")
40 f := func(i int, s *Selection) bool {
41 return i == 8
42 }
43 b.StartTimer()
44 for i := 0; i < b.N; i++ {
45 y = sel.IsFunction(f)
46 }
47 if !y {
48 b.Fatal("want true")
49 }
50}
51
52func BenchmarkIsSelection(b *testing.B) {
53 var y bool

Callers

nothing calls this directly

Calls 3

DocWFunction · 0.85
FindMethod · 0.80
IsFunctionMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…