summaryrefslogtreecommitdiff
path: root/test/lisp/dom-tests.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/dom-tests.el')
-rw-r--r--test/lisp/dom-tests.el10
1 files changed, 10 insertions, 0 deletions
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")) "<div class=\"default\"> </div>"))
+ (should (equal
+ (buffer-string)
+ (concat "<samp class=\"samp\">"
+ "&lt;div class=&quot;default&quot;&gt; &lt;/div&gt;"
+ "</samp>")))))
+
(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)))