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

Function TestNegativeSliceBoth

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

Source from the content-addressed store, hash-verified

145}
146
147func TestNegativeSliceBoth(t *testing.T) {
148 sel := Doc().Find(".container-fluid").Slice(-3, -1)
149 assertLength(t, sel.Nodes, 2)
150 assertSelectionIs(t, sel.Eq(0), "#cf2")
151 assertSelectionIs(t, sel.Eq(1), "#cf3")
152}
153
154func TestNegativeSliceToEnd(t *testing.T) {
155 sel := Doc().Find(".container-fluid").Slice(-3, ToEnd)

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