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

Function TestIndexSelector

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

Source from the content-addressed store, hash-verified

209}
210
211func TestIndexSelector(t *testing.T) {
212 sel := Doc().Find(".hero-unit")
213 if i := sel.IndexSelector("div"); i != 4 {
214 t.Errorf("Expected index of 4, got %v.", i)
215 }
216}
217
218func TestIndexSelectorInvalid(t *testing.T) {
219 sel := Doc().Find(".hero-unit")

Callers

nothing calls this directly

Calls 3

DocFunction · 0.85
FindMethod · 0.80
IndexSelectorMethod · 0.80

Tested by

no test coverage detected