mirror of
https://github.com/PuerkitoBio/goquery
synced 2025-09-26 21:01:21 +08:00
implement tests for selection methods with invalid selector strings
This commit is contained in:
@@ -9,6 +9,16 @@ func TestAdd(t *testing.T) {
|
||||
assertLength(t, sel.Nodes, 19)
|
||||
}
|
||||
|
||||
func TestAddInvalid(t *testing.T) {
|
||||
sel1 := Doc().Find("div.row-fluid")
|
||||
sel2 := sel1.Add("")
|
||||
assertLength(t, sel1.Nodes, 19)
|
||||
assertLength(t, sel2.Nodes, 19)
|
||||
if sel1 == sel2 {
|
||||
t.Errorf("selections should not be the same")
|
||||
}
|
||||
}
|
||||
|
||||
func TestAddRollback(t *testing.T) {
|
||||
sel := Doc().Find(".pvk-content")
|
||||
sel2 := sel.Add("a").End()
|
||||
|
Reference in New Issue
Block a user