mirror of
https://github.com/PuerkitoBio/goquery
synced 2025-10-06 17:27:08 +08:00
add Add() and AndSelf(), with tests
This commit is contained in:
@@ -44,6 +44,16 @@ func TestFilterSelection(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterSelectionNil(t *testing.T) {
|
||||
var sel2 *Selection
|
||||
|
||||
sel := Doc().Find(".link")
|
||||
sel3 := sel.FilterSelection(sel2)
|
||||
if len(sel3.Nodes) != 0 {
|
||||
t.Errorf("Expected no node, found %v.", len(sel3.Nodes))
|
||||
}
|
||||
}
|
||||
|
||||
func TestNot(t *testing.T) {
|
||||
sel := Doc().Find(".span12").Not(".alert")
|
||||
if len(sel.Nodes) != 1 {
|
||||
|
Reference in New Issue
Block a user