#include <boost/test/unit_test.hpp>
#include <iostream>
#include <string>
#include <websocketpp/utilities.hpp>
Go to the source code of this file.
◆ BOOST_TEST_MODULE
#define BOOST_TEST_MODULE utility |
◆ BOOST_AUTO_TEST_CASE() [1/5]
BOOST_AUTO_TEST_CASE |
( |
string_replace_all | | ) |
|
Definition at line 65 of file utilities.cpp.
65 {
66 std::string
source =
"foo \"bar\" baz";
67 std::string dest = "foo \\\"bar\\\" baz";
68
71}
std::string string_replace_all(std::string subject, std::string const &search, std::string const &replace)
Replace all occurrances of a substring with another.
const CharType(& source)[N]
◆ BOOST_AUTO_TEST_CASE() [2/5]
BOOST_AUTO_TEST_CASE |
( |
substr_found | | ) |
|
Definition at line 38 of file utilities.cpp.
38 {
39 std::string haystack = "abc123";
40 std::string needle = "abc";
41
43}
T::const_iterator ci_find_substr(T const &haystack, T const &needle, std::locale const &loc=std::locale())
Find substring (case insensitive)
◆ BOOST_AUTO_TEST_CASE() [3/5]
BOOST_AUTO_TEST_CASE |
( |
substr_found_ci | | ) |
|
Definition at line 45 of file utilities.cpp.
45 {
46 std::string haystack = "abc123";
47 std::string needle = "aBc";
48
50}
◆ BOOST_AUTO_TEST_CASE() [4/5]
BOOST_AUTO_TEST_CASE |
( |
substr_not_found | | ) |
|
Definition at line 52 of file utilities.cpp.
52 {
53 std::string haystack = "abd123";
54 std::string needle = "abcd";
55
57}
◆ BOOST_AUTO_TEST_CASE() [5/5]
BOOST_AUTO_TEST_CASE |
( |
to_lower | | ) |
|
Definition at line 59 of file utilities.cpp.
59 {
60 std::string in = "AbCd";
61
63}
std::string to_lower(std::string const &in)
Convert a string to lowercase.