aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog5
-rw-r--r--test/automated/xml-parse-tests.el15
2 files changed, 18 insertions, 2 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index d9d9bc5a9fa..3ff7124893a 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
12012-07-02 Chong Yidong <cyd@gnu.org>
2
3 * automated/xml-parse-tests.el (xml-parse-tests--data): More
4 testcases.
5
12012-07-01 Chong Yidong <cyd@gnu.org> 62012-07-01 Chong Yidong <cyd@gnu.org>
2 7
3 * automated/xml-parse-tests.el: New file. 8 * automated/xml-parse-tests.el: New file.
diff --git a/test/automated/xml-parse-tests.el b/test/automated/xml-parse-tests.el
index 8322a8c6ff9..ec3d7ca3065 100644
--- a/test/automated/xml-parse-tests.el
+++ b/test/automated/xml-parse-tests.el
@@ -33,15 +33,26 @@
33 '(;; General entity substitution 33 '(;; General entity substitution
34 ("<?xml version=\"1.0\"?><!DOCTYPE foo SYSTEM \"bar.dtd\" [<!ENTITY ent \"AbC\">]><foo a=\"b\"><bar>&ent;;</bar></foo>" . 34 ("<?xml version=\"1.0\"?><!DOCTYPE foo SYSTEM \"bar.dtd\" [<!ENTITY ent \"AbC\">]><foo a=\"b\"><bar>&ent;;</bar></foo>" .
35 ((foo ((a . "b")) (bar nil "AbC;")))) 35 ((foo ((a . "b")) (bar nil "AbC;"))))
36 ("<?xml version=\"1.0\"?><foo>&amp;amp;&#38;apos;&apos;&lt;&gt;&quot;</foo>" .
37 ((foo () "&amp;&apos;'<>\"")))
36 ;; Parameter entity substitution 38 ;; Parameter entity substitution
37 ("<?xml version=\"1.0\"?><!DOCTYPE foo SYSTEM \"bar.dtd\" [<!ENTITY % pent \"AbC\"><!ENTITY ent \"%pent;\">]><foo a=\"b\"><bar>&ent;;</bar></foo>" . 39 ("<?xml version=\"1.0\"?><!DOCTYPE foo SYSTEM \"bar.dtd\" [<!ENTITY % pent \"AbC\"><!ENTITY ent \"%pent;\">]><foo a=\"b\"><bar>&ent;;</bar></foo>" .
38 ((foo ((a . "b")) (bar nil "AbC;")))) 40 ((foo ((a . "b")) (bar nil "AbC;"))))
39 ;; Tricky parameter entity substitution (like XML spec Appendix D) 41 ;; Tricky parameter entity substitution (like XML spec Appendix D)
40 ("<?xml version='1.0'?><!DOCTYPE foo [ <!ENTITY % xx '&#37;zz;'><!ENTITY % zz '&#60;!ENTITY ent \"b\" >' > %xx; ]><foo>A&ent;C</foo>" . 42 ("<?xml version='1.0'?><!DOCTYPE foo [ <!ENTITY % xx '&#37;zz;'><!ENTITY % zz '&#60;!ENTITY ent \"b\" >' > %xx; ]><foo>A&ent;C</foo>" .
41 ((foo nil "AbC"))) 43 ((foo () "AbC")))
42 ;; Bug#7172 44 ;; Bug#7172
43 ("<?xml version=\"1.0\"?><!DOCTYPE foo [ <!ELEMENT EXAM_PLE EMPTY> ]><foo></foo>" . 45 ("<?xml version=\"1.0\"?><!DOCTYPE foo [ <!ELEMENT EXAM_PLE EMPTY> ]><foo></foo>" .
44 ((foo nil)))) 46 ((foo ())))
47 ;; Entities referencing entities, in character data
48 ("<!DOCTYPE foo [ <!ENTITY b \"B\"><!ENTITY abc \"a&b;c\">]><foo>&abc;</foo>" .
49 ((foo () "aBc")))
50 ;; Entities referencing entities, in attribute values
51 ("<!DOCTYPE foo [ <!ENTITY b \"B\"><!ENTITY abc \"a&b;c\">]><foo a=\"-&abc;-\">1</foo>" .
52 ((foo ((a . "-aBc-")) "1")))
53 ;; Character references must be treated as character data
54 ("<foo>AT&amp;T;</foo>" . ((foo () "AT&T;")))
55 ("<foo>&#38;amp;</foo>" . ((foo () "&amp;"))))
45 "Alist of XML strings and their expected parse trees.") 56 "Alist of XML strings and their expected parse trees.")
46 57
47(ert-deftest xml-parse-tests () 58(ert-deftest xml-parse-tests ()