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

Function TestSliceToEnd

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

Source from the content-addressed store, hash-verified

102}
103
104func TestSliceToEnd(t *testing.T) {
105 sel := Doc().Find(".pvk-content").Slice(1, ToEnd)
106
107 assertLength(t, sel.Nodes, 2)
108 assertSelectionIs(t, sel.Eq(0), "#pc2")
109 if _, ok := sel.Eq(1).Attr("id"); ok {
110 t.Error("Want no attribute ID, got one")
111 }
112}
113
114func TestSliceEmpty(t *testing.T) {
115 defer assertPanic(t)

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected