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

Function TestEqNegative

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

Source from the content-addressed store, hash-verified

58}
59
60func TestEqNegative(t *testing.T) {
61 sel := Doc().Find(".pvk-content").Eq(-1)
62 assertLength(t, sel.Nodes, 1)
63
64 // Should contain Footer
65 foot := Doc().Find(".footer")
66 if !sel.Contains(foot.Nodes[0]) {
67 t.Error("Index -1 of .pvk-content should contain .footer.")
68 }
69}
70
71func TestEqEmpty(t *testing.T) {
72 sel := Doc().Find("something_random_that_does_not_exists").Eq(0)

Callers

nothing calls this directly

Calls 5

DocFunction · 0.85
assertLengthFunction · 0.85
EqMethod · 0.80
FindMethod · 0.80
ContainsMethod · 0.80

Tested by

no test coverage detected