28#define BOOST_TEST_MODULE utility
29#include <boost/test/unit_test.hpp>
36BOOST_AUTO_TEST_SUITE (
utility )
39 std::string haystack =
"abc123";
40 std::string needle =
"abc";
46 std::string haystack =
"abc123";
47 std::string needle =
"aBc";
53 std::string haystack =
"abd123";
54 std::string needle =
"abcd";
60 std::string in =
"AbCd";
66 std::string
source =
"foo \"bar\" baz";
67 std::string dest =
"foo \\\"bar\\\" baz";
70 BOOST_CHECK_EQUAL(string_replace_all(
source,
"\"",
"\\\""),dest);
73BOOST_AUTO_TEST_SUITE_END()
T::const_iterator ci_find_substr(T const &haystack, T const &needle, std::locale const &loc=std::locale())
Find substring (case insensitive)
std::string string_replace_all(std::string subject, std::string const &search, std::string const &replace)
Replace all occurrances of a substring with another.
std::string to_lower(std::string const &in)
Convert a string to lowercase.
const CharType(& source)[N]
BOOST_AUTO_TEST_CASE(substr_found)