fix Find() so that is searches only descendents

This commit is contained in:
Martin Angers
2012-09-01 20:00:44 -04:00
parent 505516529b
commit 3631dc402c
3 changed files with 26 additions and 7 deletions

View File

@@ -11,6 +11,13 @@ func TestFind(t *testing.T) {
}
}
func TestFindNotSelf(t *testing.T) {
sel := Doc().Find("h1").Find("h1")
if len(sel.Nodes) > 0 {
t.Errorf("Expected no node, found %v.", len(sel.Nodes))
}
}
func TestFindInvalidSelector(t *testing.T) {
defer func() {
if e := recover(); e == nil {