7 #define BOOST_TEST_MODULE (to_indented_string test) 9 #include "boost/test/unit_test.hpp" 16 using namespace fhicl;
19 using ints = std::vector<int>;
23 auto to_ind_str = [](
auto const& pset) {
return pset.to_indented_string(); };
26 BOOST_AUTO_TEST_SUITE(values_test)
32 BOOST_TEST(to_ind_str(pset) ==
"");
35 BOOST_TEST(to_ind_str(pset) ==
"a: \"string1\"\n");
37 pset.
put<
int>(
"b", -1234);
38 BOOST_TEST(to_ind_str(pset) ==
"a: \"string1\"\n" 41 pset.
put<
bool>(
"c",
false);
42 BOOST_TEST(to_ind_str(pset) ==
"a: \"string1\"\n" 51 BOOST_TEST(to_ind_str(pset) ==
"a: []\n");
54 BOOST_TEST(to_ind_str(pset) ==
"a: []\n" 59 pset.
put<
ints>(
"c", {11, 12, 13});
60 BOOST_TEST(to_ind_str(pset) ==
"a: []\n" 77 BOOST_TEST(to_ind_str(pset) ==
"p1: {}\n");
81 BOOST_TEST(to_ind_str(pset) ==
"p1: {}\n" 86 p.
put<
int>(
"b", -1234);
88 BOOST_TEST(to_ind_str(pset) ==
"p1: {}\n" 97 p.
put<
bool>(
"c",
false);
99 BOOST_TEST(to_ind_str(pset) ==
"p1: {}\n" 117 p.
put<
ints>(
"v", {11, 12, 13});
121 BOOST_TEST(to_ind_str(pset) ==
"p: {\n" 133 std::iota(v.begin(), v.end(), 1);
140 BOOST_TEST(to_ind_str(pset) ==
"p: {\n" 174 BOOST_TEST(to_ind_str(pset) ==
"p: {\n" 182 std::iota(v.begin(), v.end(), 1);
192 BOOST_TEST(to_ind_str(pset) ==
"p: {\n" 210 BOOST_AUTO_TEST_SUITE_END()
std::vector< ints > nested_ints
BOOST_AUTO_TEST_CASE(atoms)
void put(std::string const &key)