pike.git / lib / modules / Parser.pmod / XML.pmod / testsuite.in

version» Context lines:

pike.git/lib/modules/Parser.pmod/XML.pmod/testsuite.in:19:   test_tree_eq([[ ("<a>hej &x.y; hopp</a>")->render_xml(); ]],   [[ "<a>hej &amp;x.y; hopp</a>" ]])   test_tree_eq([[ ("<a>hej &x.y; hopp</a>")->render_xml(1); ]],   [[ "<a>hej &x.y; hopp</a>" ]])   test_eq([[ (string)Parser.XML.Tree.parse_input("<a><b> <c/> </b></a>") ]],   [[ "<a><b> <c/> </b></a>" ]])   test_tree_eq([[ ("<p>a<![CDATA[b]""]>c</p>")[0][0]->get_text() ]],   [[ "abc" ]])   test_tree_eq([[ ("<?xml version=\"1.0\"?><!DOCTYPE greeting SYSTEM \"hello.dtd\"><!-- comment -- --><x/>")->render_xml() ]],   [[ "<?xml version='1.0' encoding='utf-8'?><!DOCTYPE greeting SYSTEM \"hello.dtd\"><!-- comment -- --><x/>" ]]) + test_tree_eq([[ ("<x><a foo='x\"'/><b bar=\"x'y\"/></x>")->render_xml() ]], + [[ "<x><a foo='x\"'/><b bar=\"x'y\"/></x>" ]])      // Check that any xml and/or doctype header survives the parsing.   // Check also that the headers are rendered properly.   test_tree_eq([[ ("<?xml version='1.0' encoding='iso-8859-1'?><!DOCTYPE foo [ <!ELEMENT foo (foo)*> ]><foo><foo/><foo/></foo>")->render_xml() ]],    [[ "<?xml version='1.0' encoding='iso-8859-1'?><!DOCTYPE foo [ <!ELEMENT foo (foo)*> ]><foo><foo/><foo/></foo>" ]])   test_tree_eq([[ ("<?xml version='1.0' encoding='utf-8'?><!DOCTYPE foo PUBLIC \"-//EN\" \"foo.dtd\" ><foo><foo/><foo/></foo>")->render_xml() ]],    [[ "<?xml version='1.0' encoding='utf-8'?><!DOCTYPE foo PUBLIC \"-//EN\" \"foo.dtd\"><foo><foo/><foo/></foo>" ]])      dnl You could argue that the decoding should cause an error as 0x2122   dnl is outside of iso-8859-1, but we could just manipulate the text