implement tests for selection methods with invalid selector strings

This commit is contained in:
Martin Angers
2016-06-15 08:42:27 -04:00
parent 2cd8b4e49a
commit 9cc531274b
7 changed files with 155 additions and 20 deletions

View File

@@ -11,6 +11,13 @@ func TestIs(t *testing.T) {
}
}
func TestIsInvalid(t *testing.T) {
sel := Doc().Find(".footer p:nth-child(1)")
if sel.Is("") {
t.Error("Is should not succeed with invalid selector string")
}
}
func TestIsPositional(t *testing.T) {
sel := Doc().Find(".footer p:nth-child(2)")
if !sel.Is("p:nth-child(2)") {