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

Function TestIndexOfSelection

array_test.go:239–245  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

237}
238
239func TestIndexOfSelection(t *testing.T) {
240 sel := Doc().Find("div")
241 sel2 := Doc().Find(".hero-unit")
242 if i := sel.IndexOfSelection(sel2); i != 4 {
243 t.Errorf("Expected index of 4, got %v.", i)
244 }
245}

Callers

nothing calls this directly

Calls 3

DocFunction · 0.85
FindMethod · 0.80
IndexOfSelectionMethod · 0.80

Tested by

no test coverage detected