From: Eshel Yaron Date: Tue, 16 Jan 2024 14:29:12 +0000 (+0100) Subject: ; Add a test for 'dom-print' X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=98118223bf4fc4ccacdd9bb521c3fdcd226e3847;p=emacs.git ; Add a test for 'dom-print' * test/lisp/dom-tests.el (dom-tests-print): New test. --- diff --git a/test/lisp/dom-tests.el b/test/lisp/dom-tests.el index 8cbfb9ad9df..a4e913541bf 100644 --- a/test/lisp/dom-tests.el +++ b/test/lisp/dom-tests.el @@ -209,6 +209,16 @@ child results in an error." (dom-pp node t) (should (equal (buffer-string) "(\"foo\" nil)"))))) +(ert-deftest dom-tests-print () + "Test that `dom-print' correctly encodes HTML reserved characters." + (with-temp-buffer + (dom-print '(samp ((class . "samp")) "
")) + (should (equal + (buffer-string) + (concat "" + "<div class="default"> </div>" + ""))))) + (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)))