summaryrefslogtreecommitdiff
path: root/tests/test_xpath_paths.cpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-05-29 22:51:38 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-05-29 22:51:38 +0000
commit43fc0ca13bf30596aa206edd9511b94a337986ca (patch)
treeccc730ed0d90c1c329559d232001e6aacaa49112 /tests/test_xpath_paths.cpp
parent1c567deccacf26e93927878b8c294377c4d5a9cf (diff)
tests: Added more Xalan tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@467 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/test_xpath_paths.cpp')
-rw-r--r--tests/test_xpath_paths.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/test_xpath_paths.cpp b/tests/test_xpath_paths.cpp
index 9de6fb1..2d00c34 100644
--- a/tests/test_xpath_paths.cpp
+++ b/tests/test_xpath_paths.cpp
@@ -164,7 +164,7 @@ TEST_XML(xpath_paths_axes_descendant_or_self, "<node attr='value'><child attr='v
CHECK_XPATH_NODESET(n, STR("another/descendant-or-self:: node()")) % 7 % 8; // another, subchild
CHECK_XPATH_NODESET(n, STR("last/descendant-or-self:: node()")) % 9; // last
- CHECK_XPATH_NODESET(n, STR("child/@attr/descendant-or-self::node()"));
+ CHECK_XPATH_NODESET(n, STR("child/@attr/descendant-or-self::node()")) % 5; // @attr
}
TEST_XML(xpath_paths_axes_ancestor_or_self, "<node attr='value'><child attr='value'><subchild/></child><another><subchild/></another><last/></node>")
@@ -179,6 +179,8 @@ TEST_XML(xpath_paths_axes_ancestor_or_self, "<node attr='value'><child attr='val
CHECK_XPATH_NODESET(n, STR("child/@attr/ancestor-or-self:: node()")) % 5 % 4 % 2 % 1; // @attr, child, node, root
CHECK_XPATH_NODESET(n, STR("ancestor-or-self:: node()")) % 2 % 1; // root, node
CHECK_XPATH_NODESET(doc, STR("ancestor-or-self:: node()")) % 1; // root
+ CHECK_XPATH_NODESET(n, STR("ancestor-or-self:: node()")) % 2 % 1; // root, node
+ CHECK_XPATH_NODESET(n, STR("last/ancestor-or-self::node()")) % 9 % 2 % 1; // root, node, last
}
TEST_XML(xpath_paths_axes_abbrev, "<node attr='value'><foo/></node>")
@@ -284,6 +286,12 @@ TEST_XML_FLAGS(xpath_paths_nodetest_type, "<node attr='value'>pcdata<child/><?pi
CHECK_XPATH_FAIL(STR("processing-instruction('', '')"));
}
+TEST_XML_FLAGS(xpath_paths_nodetest_principal, "<node attr='value'>pcdata<child/><?pi1 value?><?pi2 value?><!--comment--><![CDATA[cdata]]></node>", parse_default | parse_pi | parse_comments)
+{
+ // $$$ self::* should not select attribute nodes (?)
+ // $$$ name, * and name:* should check type = elem (?)
+}
+
TEST_XML(xpath_paths_absolute, "<node><foo><foo/><foo/></foo></node>")
{
xml_node c;