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

Function TestSlice

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

Source from the content-addressed store, hash-verified

95}
96
97func TestSlice(t *testing.T) {
98 sel := Doc().Find(".pvk-content").Slice(0, 2)
99
100 assertLength(t, sel.Nodes, 2)
101 assertSelectionIs(t, sel, "#pc1", "#pc2")
102}
103
104func TestSliceToEnd(t *testing.T) {
105 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