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

Function TestNegativeSliceStart

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

Source from the content-addressed store, hash-verified

143}
144
145func TestNegativeSliceStart(t *testing.T) {
146 sel := Doc().Find(".container-fluid").Slice(-2, 3)
147 assertLength(t, sel.Nodes, 1)
148 assertSelectionIs(t, sel.Eq(0), "#cf3")
149}
150
151func TestNegativeSliceEnd(t *testing.T) {
152 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