1 #define BOOST_TEST_MODULE (path_specs test) 2 #include "boost/test/unit_test.hpp" 17 auto const& sequence = table.find(trigger_paths);
23 trigger_path_specs_for(
std::string const& sequence_str)
25 return path_specs_from(trigger_paths +
": " + sequence_str);
35 BOOST_AUTO_TEST_SUITE(path_specs_t)
39 BOOST_TEST(trigger_path_specs_for(
"[]").
empty());
44 auto const path_specs = trigger_path_specs_for(
"[a]");
51 auto const path_specs = trigger_path_specs_for(
"['1:a']");
58 auto const path_specs = trigger_path_specs_for(
"[a, '2:c', '3:d']");
67 auto const path_specs = path_specs_from(
"trigger_paths: [a]\n" 68 "trigger_paths[100]: c");
71 BOOST_TEST(
path_specs[1] == spec_for(
"c", 100));
76 BOOST_CHECK_EXCEPTION(
79 e.explain_self().find(
"has already been specified in the ") !=
82 BOOST_CHECK_EXCEPTION(
83 trigger_path_specs_for(
"[a, '1:a']"),
art::Exception, [](
auto const&
e) {
85 e.explain_self().find(
86 "has already been specified (perhaps implicitly) ") !=
89 BOOST_CHECK_EXCEPTION(
90 trigger_path_specs_for(
"['0:a', '1:a']"),
94 e.explain_self().find(
95 "has already been specified (perhaps implicitly) ") !=
98 auto const path_specs = trigger_path_specs_for(
"['1:a', '1:a']");
99 BOOST_CHECK(
size(path_specs) == 1ull);
100 BOOST_CHECK(path_specs[0] == spec_for(
"a", 1));
105 BOOST_CHECK_EXCEPTION(
106 trigger_path_specs_for(
"['1:a', 'b']"),
art::Exception, [](
auto const&
e) {
108 e.explain_self().find(
"has already been assigned to path name ") !=
111 BOOST_CHECK_EXCEPTION(
112 trigger_path_specs_for(
"['3:a', '3:b']"),
116 e.explain_self().find(
"has already been assigned to path name ") !=
121 BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(empty_path_spec)
std::vector< ModuleSpec > sequence_to_entries(sequence_t const &seq, bool const allow_nil_entries)
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
std::vector< PathSpec > path_specs(std::vector< std::string > const &path_spec_strs)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
intermediate_table parse_document(std::string const &filename, cet::filepath_maker &maker)
std::vector< art::PathSpec > path_specs(std::vector< ModuleSpec > const &selection_override_entries, std::string const &path_selection_override)
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.