Macros | Functions
trim_test.cc File Reference
#include "boost/test/unit_test.hpp"
#include "cetlib/trim.h"

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   (trim test)
 

Functions

 BOOST_AUTO_TEST_CASE (trimmed_test)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (trim test)

Definition at line 1 of file trim_test.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( trimmed_test  )

Definition at line 18 of file trim_test.cc.

19 {
20  string s1("Hello.");
21 
22  {
23  string s2(s1);
24  BOOST_TEST(trim_left(s2) == s1);
25  }
26  {
27  string s2(s1);
28  BOOST_TEST(trim_right(s2) == s1);
29  }
30  {
31  string s2(s1);
32  BOOST_TEST(trim(s2) == s1);
33  }
34 
35  {
36  string s2(s1);
37  BOOST_TEST(trim_left_copy(s2) == s1);
38  }
39  {
40  string s2(s1);
41  BOOST_TEST(trim_right_copy(s2) == s1);
42  }
43  {
44  string s2(s1);
45  BOOST_TEST(trim_copy(s2) == s1);
46  }
47 }
static std::string trim(const std::string &str, const std::string &whitespace=" \t")
Definition: doxyindexer.cpp:47
std::string & trim_right(std::string &source, std::string const &t=" ")
Definition: trim.h:33
std::string trim_copy(std::string source, std::string const &t=" ")
Definition: trim.h:66
std::string trim_right_copy(std::string source, std::string const &t=" ")
Definition: trim.h:54
std::string & trim_left(std::string &source, std::string const &t=" ")
Definition: trim.h:39
std::string trim_left_copy(std::string source, std::string const &t=" ")
Definition: trim.h:60