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

Function TestIndexSelector

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

Source from the content-addressed store, hash-verified

198}
199
200func TestIndexSelector(t *testing.T) {
201 sel := Doc().Find(".hero-unit")
202 if i := sel.IndexSelector("div"); i != 4 {
203 t.Errorf("Expected index of 4, got %v.", i)
204 }
205}
206
207func TestIndexSelectorInvalid(t *testing.T) {
208 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