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

Function TestLast

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

Source from the content-addressed store, hash-verified

26}
27
28func TestLast(t *testing.T) {
29 sel := Doc().Find(".pvk-content").Last()
30 assertLength(t, sel.Nodes, 1)
31
32 // Should contain Footer
33 foot := Doc().Find(".footer")
34 if !sel.Contains(foot.Nodes[0]) {
35 t.Error("Last .pvk-content should contain .footer.")
36 }
37}
38
39func TestLastEmpty(t *testing.T) {
40 sel := Doc().Find(".pvk-zzcontentzz").Last()

Callers

nothing calls this directly

Calls 5

DocFunction · 0.85
assertLengthFunction · 0.85
LastMethod · 0.80
FindMethod · 0.80
ContainsMethod · 0.80

Tested by

no test coverage detected