pike.git/
lib/
modules/
Parser.pmod/
XML.pmod/
testsuite.in
Branch:
Tag:
Non-build tags
All tags
No tags
2005-12-18
2005-12-18 03:34:50 by Martin Nilsson <mani@lysator.liu.se>
0d3929f23baefaa3fbb2281d90c712626efa928e (
33
lines) (+
27
/-
6
)
[
Show
|
Annotate
]
Branch:
7.9
A bunch more of tests
Rev: lib/modules/Parser.pmod/XML.pmod/testsuite.in:1.7
1:
START_MARKER
-
// $Id: testsuite.in,v 1.
6
2005/
10
/
31
11
:
38
:
07
nilsson Exp $
+
// $Id: testsuite.in,v 1.
7
2005/
12
/
18
03
:
34
:
50
nilsson 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_eval_error([[ Parser.XML.Tree.parse_input("<foo>", 0, 0, 0, 1); ]])
-
test_eq([[
Parser.XML.Tree.parse_input
("<a>foo > hej &x.y; hopp < bar</a>")->render_xml()
;
]],
+
test_
tree_
eq([[ ("<a>foo > hej &x.y; hopp < bar</a>")->render_xml() ]],
[[ "<a>foo > hej &x.y; hopp < bar</a>" ]])
-
test_eq([[
Parser.XML.Tree.parse_input
("<a>foo > hej &x.y; hopp < bar</a>")->render_xml(1); ]],
+
test_
tree_
eq([[ ("<a>foo > hej &x.y; hopp < bar</a>")->render_xml(1); ]],
[[ "<a>foo > hej &x.y; hopp < bar</a>" ]])
-
test_eq([[
Parser.XML.Tree.parse_input
("<a>hej &x.y; hopp</a>")->render_xml(); ]],
+
test_
tree_
eq([[ ("<a>hej &x.y; hopp</a>")->render_xml(); ]],
[[ "<a>hej &x.y; hopp</a>" ]])
-
test_eq([[
Parser.XML.Tree.parse_input
("<a>hej &x.y; hopp</a>")->render_xml(1); ]],
+
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_eq([[
Parser.XML.Tree.parse_input
("<p>a<![CDATA[b]""]>c</p>")[0][0]->get_text() ]],
+
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_any([[
+
+
class A {
+
inherit Parser.XML.Tree.Node;
+
public array(this_program) mChildren = ({});
+
};
+
+
return sizeof(A("<!-- --><!-- --><x/>")->mChildren);
+
]], 3)
+
+
// NSTree // XML NS section 2