From 3fcc530b341709000b7acf4e8b85ad11cac0927d Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Thu, 2 Oct 2014 03:06:59 +0000 Subject: tests: Add missing tests to increase code coverage git-svn-id: https://pugixml.googlecode.com/svn/trunk@1038 99668b35-9821-0410-8761-19e4c4f06640 --- tests/test_xpath_functions.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/test_xpath_functions.cpp') 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, "foobar") +{ + 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, "foobar") +{ + 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, "123") { xml_node c; -- cgit v1.2.3