From 98118223bf4fc4ccacdd9bb521c3fdcd226e3847 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Tue, 16 Jan 2024 15:29:12 +0100 Subject: [PATCH] ; Add a test for 'dom-print' * test/lisp/dom-tests.el (dom-tests-print): New test. --- test/lisp/dom-tests.el | 10 ++++++++++ 1 file changed, 10 insertions(+) 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))) -- 2.39.5