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

Function TestSlice

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

Source from the content-addressed store, hash-verified

106}
107
108func TestSlice(t *testing.T) {
109 sel := Doc().Find(".pvk-content").Slice(0, 2)
110
111 assertLength(t, sel.Nodes, 2)
112 assertSelectionIs(t, sel, "#pc1", "#pc2")
113}
114
115func TestSliceToEnd(t *testing.T) {
116 sel := Doc().Find(".pvk-content").Slice(1, ToEnd)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected