#include "boost/test/unit_test.hpp"
#include "cetlib/replace_all.h"
#include <string>
Go to the source code of this file.
#define BOOST_TEST_MODULE (replace_all_test) |
BOOST_AUTO_TEST_CASE |
( |
replace_simple |
| ) |
|
Definition at line 25 of file replace_all_test.cc.
27 testit(
"Once upon a time",
"a",
"some",
"Once upon some time");
28 testit(
"Once upon a time",
" ",
"_",
"Once_upon_a_time");
29 testit(
"Once upon a time",
"time",
"song",
"Once upon a song");
BOOST_AUTO_TEST_CASE |
( |
no_replace |
| ) |
|
Definition at line 32 of file replace_all_test.cc.
34 testit(
"Once upon a time",
"z",
"y",
"Once upon a time");
BOOST_AUTO_TEST_CASE |
( |
edge_replace |
| ) |
|
Definition at line 37 of file replace_all_test.cc.
39 testit(
"Once upon a time",
"O",
"o",
"once upon a time");
40 testit(
"Once upon a timE",
"E",
"e",
"Once upon a time");
41 testit(
"Once upuponon a time",
"upon",
"",
"Once upon a time");
BOOST_AUTO_TEST_CASE |
( |
repeat_replace |
| ) |
|
Definition at line 44 of file replace_all_test.cc.
46 testit(
"Once uponuponupon a time",
"upon",
"-",
"Once --- a time");
47 testit(
"Once --- a time",
"-",
"z",
"Once zzz a time");
48 testit(
"Once --- a time",
"-",
"upon",
"Once uponuponupon a time");
49 testit(
"Once -------- a time",
"---",
"upon",
"Once uponupon-- a time");
BOOST_AUTO_TEST_CASE |
( |
substring_replace |
| ) |
|
Definition at line 52 of file replace_all_test.cc.
54 testit(
"Once upon a time",
"upon",
"uponst",
"Once uponst a time");
55 testit(
"Once upon a time",
"upon",
"stupon",
"Once stupon a time");