From 9a0464bdc25e4b20907f5d19a7773179c930ff08 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sun, 29 Aug 2010 15:53:34 +0000 Subject: tests: Fixed XPath substring tests git-svn-id: http://pugixml.googlecode.com/svn/trunk@700 99668b35-9821-0410-8761-19e4c4f06640 --- tests/test_xpath_functions.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test_xpath_functions.cpp b/tests/test_xpath_functions.cpp index 1d533b7..b0d0b52 100644 --- a/tests/test_xpath_functions.cpp +++ b/tests/test_xpath_functions.cpp @@ -446,7 +446,14 @@ TEST(xpath_string_substring) CHECK_XPATH_STRING(c, STR("substring('abcd', 1, 0.5)"), STR("a")); CHECK_XPATH_STRING(c, STR("substring('abcd', 10, -5)"), STR("")); CHECK_XPATH_STRING(c, STR("substring('abcd', 0, -1)"), STR("")); - CHECK_XPATH_STRING(c, STR("substring('abcd', -100, 100)"), STR("abcd")); + CHECK_XPATH_STRING(c, STR("substring('abcd', -100, 100)"), STR("")); + CHECK_XPATH_STRING(c, STR("substring('abcd', -100, 101)"), STR("")); + CHECK_XPATH_STRING(c, STR("substring('abcd', -100, 102)"), STR("a")); + CHECK_XPATH_STRING(c, STR("substring('abcd', -100, 103)"), STR("ab")); + CHECK_XPATH_STRING(c, STR("substring('abcd', -100, 104)"), STR("abc")); + CHECK_XPATH_STRING(c, STR("substring('abcd', -100, 105)"), STR("abcd")); + CHECK_XPATH_STRING(c, STR("substring('abcd', -100, 106)"), STR("abcd")); + CHECK_XPATH_STRING(c, STR("substring('abcd', -100, 1 div 0)"), STR("abcd")); CHECK_XPATH_STRING(c, STR("substring('abcd', -1 div 0, 4)"), STR("")); CHECK_XPATH_STRING(c, STR("substring('abcd', 1 div 0, 0 div 0)"), STR("")); CHECK_XPATH_STRING(c, STR("substring('abcd', 0 div 0, 1)"), STR("")); -- cgit v1.2.3