diff options
author | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2010-08-29 15:53:34 +0000 |
---|---|---|
committer | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2010-08-29 15:53:34 +0000 |
commit | 9a0464bdc25e4b20907f5d19a7773179c930ff08 (patch) | |
tree | 3fe4038c6c46dff8819a9b26544363051f9b70e4 /tests/test_xpath_functions.cpp | |
parent | 88b4fbcff724d1775d303a27d394c6491557bfec (diff) |
tests: Fixed XPath substring tests
git-svn-id: http://pugixml.googlecode.com/svn/trunk@700 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/test_xpath_functions.cpp')
-rw-r--r-- | tests/test_xpath_functions.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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("")); |