column_width_test.cc
Go to the documentation of this file.
1 #define BOOST_TEST_MODULE (column width test)
2 #include "boost/test/unit_test.hpp"
3 
4 #include "cetlib/column_width.h"
5 
6 #include <string>
7 #include <vector>
8 
9 using column = std::vector<std::string>;
10 
11 BOOST_AUTO_TEST_SUITE(column_width)
12 
13 BOOST_AUTO_TEST_CASE(default_behavior)
14 {
15  column c;
16  BOOST_TEST(cet::column_width(c) == 0u);
17  c.push_back("abc");
18  c.push_back("abc");
19  c.push_back("ab");
20  c.push_back("a");
21  c.push_back("ab");
22  c.push_back("abc");
23  BOOST_TEST(cet::column_width(c) == 3u);
24  c.insert(c.begin(), "wxyz");
25  BOOST_TEST(cet::column_width(c) == 4u);
26  c.push_back("lmnop");
27  BOOST_TEST(cet::column_width(c) == 5u);
28 }
29 
30 BOOST_AUTO_TEST_SUITE_END()
std::string::size_type column_width(std::vector< std::string > const &)
Definition: column_width.cc:6
BOOST_AUTO_TEST_CASE(default_behavior)
std::vector< std::string > column