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

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   (rpad test)
 

Functions

 BOOST_AUTO_TEST_CASE (dont_pad_test)
 
 BOOST_AUTO_TEST_CASE (do_pad_test)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (rpad test)

Definition at line 1 of file rpad_test.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( dont_pad_test  )

Definition at line 9 of file rpad_test.cc.

10 {
11  std::string const s0("abc");
12 
13  std::string s1 = cet::rpad(s0, 0, '*');
14  BOOST_TEST(s1 == s0);
15 
16  std::string s2 = cet::rpad(s0, 1, '*');
17  BOOST_TEST(s2 == s0);
18 
19  std::string s3 = cet::rpad(s0, 2, '*');
20  BOOST_TEST(s3 == s0);
21 
22  std::string s4 = cet::rpad(s0, 3, '*');
23  BOOST_TEST(s4 == s0);
24 }
std::string string
Definition: nybbler.cc:12
std::string rpad(std::string const &pad_me, std::string::size_type wanted_size, char char_to_pad_with= ' ')
Definition: rpad.cc:10
BOOST_AUTO_TEST_CASE ( do_pad_test  )

Definition at line 26 of file rpad_test.cc.

27 {
28  std::string const s0("abc");
29 
30  std::string s1 = cet::rpad(s0, 4);
31  BOOST_TEST(s1 == s0 + ' ');
32 
33  std::string s2 = cet::rpad(s0, 5, '*');
34  BOOST_TEST(s2 == s0 + std::string(2, '*'));
35 }
std::string string
Definition: nybbler.cc:12
std::string rpad(std::string const &pad_me, std::string::size_type wanted_size, char char_to_pad_with= ' ')
Definition: rpad.cc:10