summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_xpath_operators.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_xpath_operators.cpp b/tests/test_xpath_operators.cpp
index c7fe165..c028224 100644
--- a/tests/test_xpath_operators.cpp
+++ b/tests/test_xpath_operators.cpp
@@ -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;