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

Function BenchmarkIsPositional

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

Source from the content-addressed store, hash-verified

19}
20
21func BenchmarkIsPositional(b *testing.B) {
22 var y bool
23
24 b.StopTimer()
25 sel := DocW().Find("li")
26 b.StartTimer()
27 for i := 0; i < b.N; i++ {
28 y = sel.Is("li:nth-child(2)")
29 }
30 if !y {
31 b.Fatal("want true")
32 }
33}
34
35func BenchmarkIsFunction(b *testing.B) {
36 var y bool

Callers

nothing calls this directly

Calls 3

DocWFunction · 0.85
FindMethod · 0.80
IsMethod · 0.80

Tested by

no test coverage detected