diff options
Diffstat (limited to 'tests/test_xpath_functions.cpp')
-rw-r--r-- | tests/test_xpath_functions.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_xpath_functions.cpp b/tests/test_xpath_functions.cpp index 7245bee..30ba218 100644 --- a/tests/test_xpath_functions.cpp +++ b/tests/test_xpath_functions.cpp @@ -414,6 +414,13 @@ TEST(xpath_string_substring_after) CHECK_XPATH_FAIL(STR("substring-after('a', 'b', 'c')")); } +TEST_XML(xpath_string_substring_after_heap, "<node>foo<child/>bar</node>") +{ + CHECK_XPATH_STRING(doc, STR("substring-after(node, 'fo')"), STR("obar")); + CHECK_XPATH_STRING(doc, STR("substring-after(node, 'fooba')"), STR("r")); + CHECK_XPATH_STRING(doc, STR("substring-after(node, 'foobar')"), STR("")); +} + TEST(xpath_string_substring) { xml_node c; @@ -474,6 +481,13 @@ TEST(xpath_string_substring) CHECK_XPATH_FAIL(STR("substring('', 1, 2, 3)")); } +TEST_XML(xpath_string_substring_heap, "<node>foo<child/>bar</node>") +{ + CHECK_XPATH_STRING(doc, STR("substring(node, 3)"), STR("obar")); + CHECK_XPATH_STRING(doc, STR("substring(node, 6)"), STR("r")); + CHECK_XPATH_STRING(doc, STR("substring(node, 7)"), STR("")); +} + TEST_XML(xpath_string_string_length, "<node>123</node>") { xml_node c; |