summaryrefslogtreecommitdiff
path: root/tests/test_xpath_functions.cpp
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2017-02-05 21:34:54 -0800
committerGitHub <noreply@github.com>2017-02-05 21:34:54 -0800
commita9fe2bb62e0976ab74fdb5266cc3725250eca075 (patch)
tree85c96e92afb2e3437b0eb20c805227b91e5e69f2 /tests/test_xpath_functions.cpp
parentd3b9e4e1e85d0aca562d0e6b62533e68e5a4a749 (diff)
parent10676b6b8548ddbf9458993062e6a27c2c233d48 (diff)
Merge pull request #131 from zeux/xpath-noeh
XPath: Remove exceptional control flow
Diffstat (limited to 'tests/test_xpath_functions.cpp')
-rw-r--r--tests/test_xpath_functions.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_xpath_functions.cpp b/tests/test_xpath_functions.cpp
index 211dbfb..480eb97 100644
--- a/tests/test_xpath_functions.cpp
+++ b/tests/test_xpath_functions.cpp
@@ -566,6 +566,7 @@ TEST(xpath_string_translate_table)
CHECK_XPATH_STRING(c, STR("translate('abcd\xe9 ', 'abc', 'ABC')"), STR("ABCd\xe9 "));
CHECK_XPATH_STRING(c, STR("translate('abcd\xe9 ', 'abc\xe9', 'ABC!')"), STR("ABCd! "));
+ CHECK_XPATH_STRING(c, STR("translate('abcd! ', 'abc!', 'ABC\xe9')"), STR("ABCd\xe9 "));
CHECK_XPATH_STRING(c, STR("translate('abcde', concat('abc', 'd'), 'ABCD')"), STR("ABCDe"));
CHECK_XPATH_STRING(c, STR("translate('abcde', 'abcd', concat('ABC', 'D'))"), STR("ABCDe"));
}
@@ -799,4 +800,17 @@ TEST_XML(xpath_string_concat_translate, "<node>foobar</node>")
CHECK_XPATH_STRING(doc, STR("concat('a', 'b', 'c', translate(node, 'o', 'a'), 'd')"), STR("abcfaabard"));
}
+TEST(xpath_unknown_functions)
+{
+ char_t query[] = STR("a()");
+
+ for (char ch = 'a'; ch <= 'z'; ++ch)
+ {
+ query[0] = ch;
+ CHECK_XPATH_FAIL(query);
+
+ query[0] = ch - 32;
+ CHECK_XPATH_FAIL(query);
+ }
+}
#endif