dotted_names.cc
Go to the documentation of this file.
1 #define BOOST_TEST_MODULE (has_key of dotted names test)
2 #include "boost/test/unit_test.hpp"
3 
5 
6 #include <string>
7 
8 BOOST_AUTO_TEST_SUITE(dotted_names_test)
9 
10 BOOST_AUTO_TEST_CASE(dotted_names_t)
11 {
12  std::string text("m1: { val: 3 name: boo} ");
13  auto const ps = fhicl::ParameterSet::make(text);
14 
15  BOOST_TEST(ps.has_key("m1.val"));
16  BOOST_TEST(!ps.has_key("m1.val.three"));
17  BOOST_TEST(ps.get<int>("m1.val") == 3);
18  BOOST_TEST(ps.get<std::string>("m1.name") == "boo");
19  BOOST_TEST(!ps.has_key("m0"));
20  BOOST_TEST(!ps.has_key("m0.nothing.to.see.here"));
21 }
22 
23 BOOST_AUTO_TEST_SUITE_END()
std::string string
Definition: nybbler.cc:12
static ParameterSet make(intermediate_table const &tbl)
Definition: ParameterSet.cc:68
static constexpr double ps
Definition: Units.h:99
BOOST_AUTO_TEST_CASE(dotted_names_t)
Definition: dotted_names.cc:10