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

Function TestNegativeSliceStart

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

Source from the content-addressed store, hash-verified

132}
133
134func TestNegativeSliceStart(t *testing.T) {
135 sel := Doc().Find(".container-fluid").Slice(-2, 3)
136 assertLength(t, sel.Nodes, 1)
137 assertSelectionIs(t, sel.Eq(0), "#cf3")
138}
139
140func TestNegativeSliceEnd(t *testing.T) {
141 sel := Doc().Find(".container-fluid").Slice(1, -1)

Callers

nothing calls this directly

Calls 6

DocFunction · 0.85
assertLengthFunction · 0.85
assertSelectionIsFunction · 0.85
SliceMethod · 0.80
FindMethod · 0.80
EqMethod · 0.80

Tested by

no test coverage detected