Add a new test for dom-search
This commit is contained in:
@@ -209,5 +209,13 @@ child results in an error."
|
||||
(dom-pp node t)
|
||||
(should (equal (buffer-string) "(\"foo\" nil)")))))
|
||||
|
||||
(ert-deftest dom-test-search ()
|
||||
(let ((dom '(a nil (b nil (c nil)))))
|
||||
(should (equal (dom-search dom (lambda (d) (eq (dom-tag d) 'a)))
|
||||
(list dom)))
|
||||
(should (equal (dom-search dom (lambda (d) (memq (dom-tag d) '(b c))))
|
||||
(list (car (dom-children dom))
|
||||
(car (dom-children (car (dom-children dom)))))))))
|
||||
|
||||
(provide 'dom-tests)
|
||||
;;; dom-tests.el ends here
|
||||
|
||||
Reference in New Issue
Block a user