0
0
mirror of https://github.com/zeux/pugixml.git synced 2024-12-27 13:33:17 +08:00

XPath: Add unit test for unary minus and union precedences

git-svn-id: http://pugixml.googlecode.com/svn/trunk@929 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
arseny.kapoulkine@gmail.com 2012-11-17 22:50:05 +00:00
parent ed30b95a42
commit 48f9343c05

View File

@ -435,6 +435,17 @@ TEST(xpath_operators_union_error)
CHECK_XPATH_FAIL(STR("count(.) | ."));
}
TEST_XML(xpath_operators_union_minus, "<node1>3</node1><node2>4</node2>")
{
CHECK_XPATH_FAIL(STR("(-node1) | node2"));
CHECK_XPATH_FAIL(STR("node1 | -node2"));
CHECK_XPATH_NUMBER(doc, STR("-(node1 | node2)"), -3);
CHECK_XPATH_NUMBER(doc, STR("-node1 | node2"), -3);
CHECK_XPATH_NUMBER(doc, STR("--node1 | node2"), 3);
CHECK_XPATH_NUMBER(doc, STR("-(-node1 | node2)"), 3);
CHECK_XPATH_NUMBER(doc, STR("--(-node1 | node2)"), -3);
}
TEST(xpath_operators_associativity_boolean)
{
xml_node c;