add Add() and AndSelf(), with tests

This commit is contained in:
Martin Angers
2012-08-31 10:27:45 -04:00
parent 7a69490818
commit f1e54e5311
7 changed files with 135 additions and 59 deletions

View File

@@ -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 {