mirror of
https://github.com/zeux/pugixml.git
synced 2024-12-26 21:04:25 +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:
parent
ed30b95a42
commit
48f9343c05
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user