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

version» Context lines:

pike.git/lib/modules/Parser.pmod/XML.pmod/testsuite.in:1:   START_MARKER - // $Id: testsuite.in,v 1.9 2006/01/10 17:24:28 grubba Exp $ + // $Id: testsuite.in,v 1.10 2006/07/21 10:31:46 grubba Exp $      // DOM      // Tree      define(test_tree_eq,[[    test_eq(Parser.XML.Tree.parse_input $1 ,$2)    test_eq(Parser.XML.Tree.simple_parse_input $1 ,$2) -  test_eq(Parser.XML.Tree.Node $1 ,$2) -  test_eq(Parser.XML.Tree.SimpleNode $1 ,$2) +  test_eq(Parser.XML.Tree.RootNode $1 ,$2) +  test_eq(Parser.XML.Tree.SimpleRootNode $1 ,$2)   ]])      test_eval_error([[ Parser.XML.Tree.parse_input("<foo>", 0, 0, 0, 1); ]])   test_tree_eq([[ ("<a>foo &gt; hej &x.y; hopp &lt; bar</a>")->render_xml() ]],   [[ "<a>foo &gt; hej &amp;x.y; hopp &lt; bar</a>" ]])   test_tree_eq([[ ("<a>foo &gt; hej &x.y; hopp &lt; bar</a>")->render_xml(1); ]],   [[ "<a>foo &gt; hej &x.y; hopp &lt; bar</a>" ]])   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/>" ]])    -  + // Check that any xml and/or doctype header survives the parsing. + // Check also that the headers are rendered properly. + test_tree_eq([[ Parser.XML.Tree.parse_input("<?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([[ Parser.XML.Tree.parse_input("<?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>" ]]) +    test_any([[      class A { -  inherit Parser.XML.Tree.Node; +  inherit Parser.XML.Tree.RootNode;    public array(this_program) mChildren = ({});   };      return sizeof(A("<!-- --><!-- --><x/>")->mChildren);   ]], 3)         // NSTree      // XML NS section 2