artapp_basicSourceOptions_t.cc
Go to the documentation of this file.
1 #define BOOST_TEST_MODULE (artapp basic source options)
2 #include "boost/test/unit_test.hpp"
3 
5 
6 #include <sstream>
7 
8 BOOST_AUTO_TEST_SUITE(artappBasicSourceOptionsTest)
9 
10 BOOST_AUTO_TEST_CASE(SourceListWithComments)
11 {
12  std::string const files{"f1.root\n"
13  "# This is a random comment\n"
14  "#\n"
15  "# f2.root\n"
16  "f3.root\n"
17  "f4#.root#something\n"
18  "f5.root# this file is sometimes problematic\n"
19  "f6.root\n"};
20 
21  std::istringstream is(files);
22  std::vector<std::string> slist;
23  art::detail::fillSourceList(is, slist);
24 
25  auto const ref = {"f1.root", "f3.root", "f4", "f5.root", "f6.root"};
26  BOOST_TEST(slist == ref, boost::test_tools::per_element{});
27 }
28 
29 BOOST_AUTO_TEST_SUITE_END()
std::string string
Definition: nybbler.cc:12
void fillSourceList(std::istream &ifs, std::vector< std::string > &source_list)
list files
Definition: languages.py:9
BOOST_AUTO_TEST_CASE(SourceListWithComments)