1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

Add a new test for dom-search

This commit is contained in:
Lars Ingebrigtsen 2021-08-09 14:14:01 +02:00
parent aeec97fae0
commit 4d95eca97e

View file

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