From e3293a8baa1294e51bfcd6d3fc0cb7cee756ee7c Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sun, 8 Nov 2009 12:25:56 +0000 Subject: tests: Mostly complete coverage of XPath W3C git-svn-id: http://pugixml.googlecode.com/svn/trunk@217 99668b35-9821-0410-8761-19e4c4f06640 --- tests/test_xpath_operators.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests/test_xpath_operators.cpp') diff --git a/tests/test_xpath_operators.cpp b/tests/test_xpath_operators.cpp index de18070..876e86a 100644 --- a/tests/test_xpath_operators.cpp +++ b/tests/test_xpath_operators.cpp @@ -402,4 +402,20 @@ TEST(xpath_operators_boolean_precedence) CHECK_XPATH_BOOLEAN(c, "3 > (2 > 1)", true); } +TEST_XML(xpath_operators_union, "") +{ + doc.precompute_document_order(); + + xml_node c; + xml_node n = doc.child("node"); + + CHECK_XPATH_NODESET(n, "employee | .") % 2 % 3 % 4 % 6 % 8 % 11; + CHECK_XPATH_NODESET(n, "employee[@secretary] | employee[@assistant]") % 4 % 6 % 8 % 11; + CHECK_XPATH_NODESET(n, "employee[@assistant] | employee[@secretary]") % 4 % 6 % 8 % 11; + CHECK_XPATH_NODESET(n, "employee[@secretary] | employee[@nobody]") % 4 % 8 % 11; + CHECK_XPATH_NODESET(n, "employee[@nobody] | employee[@secretary]") % 4 % 8 % 11; + CHECK_XPATH_NODESET(n, "tail/preceding-sibling::employee | .") % 2 % 3 % 4 % 6 % 8 % 11; + CHECK_XPATH_NODESET(n, ". | tail/preceding-sibling::employee | .") % 2 % 3 % 4 % 6 % 8 % 11; +} + #endif -- cgit v1.2.3