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

Function TestIndex

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

Source from the content-addressed store, hash-verified

202}
203
204func TestIndex(t *testing.T) {
205 sel := Doc().Find(".pvk-content")
206 if i := sel.Index(); i != 1 {
207 t.Errorf("Expected index of 1, got %v.", i)
208 }
209}
210
211func TestIndexSelector(t *testing.T) {
212 sel := Doc().Find(".hero-unit")

Callers

nothing calls this directly

Calls 3

DocFunction · 0.85
FindMethod · 0.80
IndexMethod · 0.80

Tested by

no test coverage detected