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

Function TestIndexOfSelection

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

Source from the content-addressed store, hash-verified

226}
227
228func TestIndexOfSelection(t *testing.T) {
229 sel := Doc().Find("div")
230 sel2 := Doc().Find(".hero-unit")
231 if i := sel.IndexOfSelection(sel2); i != 4 {
232 t.Errorf("Expected index of 4, got %v.", i)
233 }
234}

Callers

nothing calls this directly

Calls 3

DocFunction · 0.85
FindMethod · 0.80
IndexOfSelectionMethod · 0.80

Tested by

no test coverage detected