aboutsummaryrefslogtreecommitdiffstats
path: root/test/src/xml-tests.el
diff options
context:
space:
mode:
authorStefan Kangas2020-09-26 11:27:48 +0200
committerStefan Kangas2020-09-26 11:48:09 +0200
commit2dff3ea073c4118d79308178dcb3bd7bb1bb8237 (patch)
treed3b46b7ddbb9d0f03f0a882471779fcf2a8de301 /test/src/xml-tests.el
parenta3a845b0e00bbdd1bcf05882560bca15e57488cc (diff)
downloademacs-2dff3ea073c4118d79308178dcb3bd7bb1bb8237.tar.gz
emacs-2dff3ea073c4118d79308178dcb3bd7bb1bb8237.zip
Repurpose libxml test for obsolete argument
* test/src/xml-tests.el (libxml-tests): Move half this test for the recently obsoleted fourth argument to libxml-parse-xml-region... * test/lisp/xml-tests.el (xml-tests--remove-comments): ...to a new test here for xml-remove-comments. * test/src/xml-tests.el (libxml-tests--data-comments-discarded): Move test data from here... * test/lisp/xml-tests.el (xml-tests--data-with-comments): ...to here.
Diffstat (limited to 'test/src/xml-tests.el')
-rw-r--r--test/src/xml-tests.el21
1 files changed, 1 insertions, 20 deletions
diff --git a/test/src/xml-tests.el b/test/src/xml-tests.el
index d758c8868cf..800f400b3ca 100644
--- a/test/src/xml-tests.el
+++ b/test/src/xml-tests.el
@@ -42,20 +42,6 @@
42 (comment nil "comment-b") (comment nil "comment-c")))) 42 (comment nil "comment-b") (comment nil "comment-c"))))
43 "Alist of XML strings and their expected parse trees for preserved comments.") 43 "Alist of XML strings and their expected parse trees for preserved comments.")
44 44
45(defvar libxml-tests--data-comments-discarded
46 `(;; simple case
47 ("<?xml version=\"1.0\"?><foo baz=\"true\">bar</foo>"
48 . (foo ((baz . "true")) "bar"))
49 ;; toplevel comments -- first document child must not get lost
50 (,(concat "<?xml version=\"1.0\"?><foo>bar</foo><!--comment-1-->"
51 "<!--comment-2-->")
52 . (foo nil "bar"))
53 (,(concat "<?xml version=\"1.0\"?><!--comment-a--><foo a=\"b\">"
54 "<bar>blub</bar></foo><!--comment-b--><!--comment-c-->")
55 . (foo ((a . "b")) (bar nil "blub"))))
56 "Alist of XML strings and their expected parse trees for discarded comments.")
57
58
59(ert-deftest libxml-tests () 45(ert-deftest libxml-tests ()
60 "Test libxml." 46 "Test libxml."
61 (when (fboundp 'libxml-parse-xml-region) 47 (when (fboundp 'libxml-parse-xml-region)
@@ -64,11 +50,6 @@
64 (erase-buffer) 50 (erase-buffer)
65 (insert (car test)) 51 (insert (car test))
66 (should (equal (cdr test) 52 (should (equal (cdr test)
67 (libxml-parse-xml-region (point-min) (point-max))))) 53 (libxml-parse-xml-region (point-min) (point-max))))))))
68 (dolist (test libxml-tests--data-comments-discarded)
69 (erase-buffer)
70 (insert (car test))
71 (should (equal (cdr test)
72 (libxml-parse-xml-region (point-min) (point-max) nil t)))))))
73 54
74;;; libxml-tests.el ends here 55;;; libxml-tests.el ends here