summaryrefslogtreecommitdiff
path: root/tests/test_xpath_xalan_3.cpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-05-30 12:42:03 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-05-30 12:42:03 +0000
commit724a3775440be418eca2617bc970ad1bb35a67c4 (patch)
tree6b708bcb3738ab10e088f85a42744670192b9f0a /tests/test_xpath_xalan_3.cpp
parentd582a3f374cec236ed5dd403b964f486f1da67d5 (diff)
tests: Added more Xalan tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@473 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/test_xpath_xalan_3.cpp')
-rw-r--r--tests/test_xpath_xalan_3.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/tests/test_xpath_xalan_3.cpp b/tests/test_xpath_xalan_3.cpp
index 6514560..ee9253d 100644
--- a/tests/test_xpath_xalan_3.cpp
+++ b/tests/test_xpath_xalan_3.cpp
@@ -2,20 +2,6 @@
#include "common.hpp"
-TEST_XML(xpath_xalan_match, "<root><x spot='a' num='1'/><x spot='b' num='2'/><x spot='c' num='3'/><x spot='d' num='4'/><x spot='e' num='5'/><x spot='f' num='6'/><x spot='g' num='7'/><x spot='h' num='8'/><x spot='i' num='9'/><x spot='j' num='10'/><x spot='k' num='11'/><x spot='l' num='12'/></root>")
-{
- xml_node c = doc.child(STR("root"));
-
- CHECK_XPATH_NODESET(c, STR("x[(position() mod 2)=1][position() > 3]")) % 21 % 27 % 33;
- CHECK_XPATH_NODESET(c, STR("x[(position() mod 2)=1][position() > 3][position()=2]")) % 27;
- CHECK_XPATH_NODESET(c, STR("x[(position() mod 2) > 0][position() > 3][2]")) % 27;
- CHECK_XPATH_NODESET(c, STR("x[(position() mod 2)=1][position() > 3][last()]")) % 33;
- CHECK_XPATH_NODESET(c, STR("x[(position() mod 2)=1][@num > 5][last()]")) % 33;
- CHECK_XPATH_NODESET(c, STR("x[(@num mod 3)=2][position() > 2][last()]")) % 33;
- CHECK_XPATH_NODESET(c, STR("x[(position() mod 2)=1][2][@num < 10]")) % 9;
- CHECK_XPATH_NODESET(c, STR("x[(((((2*10)-4)+9) div 5) mod 3)]")) % 6;
-}
-
TEST_XML(xpath_xalan_axes_1, "<far-north><north-north-west1/><north-north-west2/><north><near-north><far-west/><west/><near-west/><center center-attr-1='c1' center-attr-2='c2' center-attr-3='c3'><near-south-west/><near-south><south><far-south/></south></near-south><near-south-east/></center><near-east/><east/><far-east/></near-north></north><north-north-east1/><north-north-east2/></far-north>")
{
xml_node center = doc.select_single_node(STR("//center")).node();
@@ -207,6 +193,12 @@ TEST_XML(xpath_xalan_axes_9, "<doc><foo att1='c'><foo att1='b'><foo att1='a'><ba
CHECK_XPATH_NODESET(baz, STR("ancestor-or-self::*[@att1][1]/@att1")) % 8;
CHECK_XPATH_NODESET(baz, STR("(ancestor-or-self::*)[@att1][1]/@att1")) % 4;
+ CHECK_XPATH_NODESET(baz, STR("ancestor::foo[1]/@att1")) % 8;
+ CHECK_XPATH_NODESET(baz, STR("(ancestor::foo[1])/@att1")) % 8;
+ CHECK_XPATH_NODESET(baz, STR("(ancestor::foo)[1]/@att1")) % 4;
+ CHECK_XPATH_NODESET(baz, STR("((ancestor::foo))[1]/@att1")) % 4;
+ CHECK_XPATH_NODESET(baz, STR("(((ancestor::foo)[1])/@att1)")) % 4;
+
xml_node bar = doc.child(STR("doc")).child(STR("bar"));
CHECK_XPATH_NODESET(bar, STR("preceding::foo[1]/@att1")) % 8;