From 5a848de085e8f2b0458ee7afba5a3d95572f11c2 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Wed, 4 Mar 2015 10:40:18 -0800 Subject: tests: Fix XPath string comparison Also add new tests for translate. These are technically redundant since other tests would catch the bug with the fixed comparison, but more tests is better. --- tests/test_xpath_functions.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/test_xpath_functions.cpp') diff --git a/tests/test_xpath_functions.cpp b/tests/test_xpath_functions.cpp index 678bc2e..eb43bb5 100644 --- a/tests/test_xpath_functions.cpp +++ b/tests/test_xpath_functions.cpp @@ -570,6 +570,14 @@ TEST(xpath_string_translate_table) CHECK_XPATH_STRING(c, STR("translate('abcde', 'abcd', concat('ABC', 'D'))"), STR("ABCDe")); } +TEST(xpath_string_translate_remove) +{ + xml_node c; + + CHECK_XPATH_STRING(c, STR("translate('000000755', '0', '')"), STR("755")); + CHECK_XPATH_STRING(c, STR("translate('000000755', concat('0', ''), '')"), STR("755")); +} + TEST_XML(xpath_nodeset_last, "") { xml_node n = doc.child(STR("node")); -- cgit v1.2.3