mirror of
https://github.com/PuerkitoBio/goquery
synced 2025-10-04 16:32:46 +08:00
add Siblings() with tests
This commit is contained in:
@@ -112,3 +112,13 @@ func TestParentsFilteredUntilNodes(t *testing.T) {
|
||||
sel = sel.ParentsFilteredUntilNodes("body", sel2.Nodes...)
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestSiblings(t *testing.T) {
|
||||
sel := Doc().Root.Find("h1").Siblings()
|
||||
AssertLength(t, sel.Nodes, 1)
|
||||
}
|
||||
|
||||
func TestSiblings2(t *testing.T) {
|
||||
sel := Doc().Root.Find(".pvk-gutter").Siblings()
|
||||
AssertLength(t, sel.Nodes, 9)
|
||||
}
|
||||
|
Reference in New Issue
Block a user