Macros | Functions
replace_all_test.cc File Reference
#include "boost/test/unit_test.hpp"
#include "cetlib/replace_all.h"
#include <string>

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   (replace_all_test)
 

Functions

 BOOST_AUTO_TEST_CASE (replace_simple)
 
 BOOST_AUTO_TEST_CASE (no_replace)
 
 BOOST_AUTO_TEST_CASE (edge_replace)
 
 BOOST_AUTO_TEST_CASE (repeat_replace)
 
 BOOST_AUTO_TEST_CASE (substring_replace)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (replace_all_test)

Definition at line 1 of file replace_all_test.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( replace_simple  )

Definition at line 25 of file replace_all_test.cc.

26 {
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");
30 }
BOOST_AUTO_TEST_CASE ( no_replace  )

Definition at line 32 of file replace_all_test.cc.

33 {
34  testit("Once upon a time", "z", "y", "Once upon a time");
35 }
BOOST_AUTO_TEST_CASE ( edge_replace  )

Definition at line 37 of file replace_all_test.cc.

38 {
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");
42 }
BOOST_AUTO_TEST_CASE ( repeat_replace  )

Definition at line 44 of file replace_all_test.cc.

45 {
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");
50 }
BOOST_AUTO_TEST_CASE ( substring_replace  )

Definition at line 52 of file replace_all_test.cc.

53 {
54  testit("Once upon a time", "upon", "uponst", "Once uponst a time");
55  testit("Once upon a time", "upon", "stupon", "Once stupon a time");
56 }