diff options
Diffstat (limited to 'test/automated/xml-parse-tests.el')
-rw-r--r-- | test/automated/xml-parse-tests.el | 15 |
1 files changed, 13 insertions, 2 deletions
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 @@ '(;; General entity substitution ("<?xml version=\"1.0\"?><!DOCTYPE foo SYSTEM \"bar.dtd\" [<!ENTITY ent \"AbC\">]><foo a=\"b\"><bar>&ent;;</bar></foo>" . ((foo ((a . "b")) (bar nil "AbC;")))) + ("<?xml version=\"1.0\"?><foo>&amp;&apos;'<>"</foo>" . + ((foo () "&''<>\""))) ;; Parameter entity substitution ("<?xml version=\"1.0\"?><!DOCTYPE foo SYSTEM \"bar.dtd\" [<!ENTITY % pent \"AbC\"><!ENTITY ent \"%pent;\">]><foo a=\"b\"><bar>&ent;;</bar></foo>" . ((foo ((a . "b")) (bar nil "AbC;")))) ;; Tricky parameter entity substitution (like XML spec Appendix D) ("<?xml version='1.0'?><!DOCTYPE foo [ <!ENTITY % xx '%zz;'><!ENTITY % zz '<!ENTITY ent \"b\" >' > %xx; ]><foo>A&ent;C</foo>" . - ((foo nil "AbC"))) + ((foo () "AbC"))) ;; Bug#7172 ("<?xml version=\"1.0\"?><!DOCTYPE foo [ <!ELEMENT EXAM_PLE EMPTY> ]><foo></foo>" . - ((foo nil)))) + ((foo ()))) + ;; Entities referencing entities, in character data + ("<!DOCTYPE foo [ <!ENTITY b \"B\"><!ENTITY abc \"a&b;c\">]><foo>&abc;</foo>" . + ((foo () "aBc"))) + ;; Entities referencing entities, in attribute values + ("<!DOCTYPE foo [ <!ENTITY b \"B\"><!ENTITY abc \"a&b;c\">]><foo a=\"-&abc;-\">1</foo>" . + ((foo ((a . "-aBc-")) "1"))) + ;; Character references must be treated as character data + ("<foo>AT&T;</foo>" . ((foo () "AT&T;"))) + ("<foo>&amp;</foo>" . ((foo () "&")))) "Alist of XML strings and their expected parse trees.") (ert-deftest xml-parse-tests () |