PathSpec_t.cc
Go to the documentation of this file.
1 #define BOOST_TEST_MODULE (PathSpec_t)
2 #include "boost/test/unit_test.hpp"
3 
5 
6 #include <cstddef>
7 #include <string>
8 #include <vector>
9 
10 BOOST_AUTO_TEST_SUITE(PathSpec_t)
11 
12 BOOST_AUTO_TEST_CASE(parse_path_spec_t)
13 {
14  std::vector<std::string> paths;
15  paths.push_back("a:p1");
16  paths.push_back("b:p2");
17  paths.push_back(" c");
18  paths.push_back("ddd\t:p3");
19  paths.push_back("eee: p4 ");
20 
21  std::vector<std::pair<std::string, std::string>> parsed(paths.size());
22  for (size_t i = 0; i < paths.size(); ++i)
23  parsed[i] = art::split_process_and_path_names(paths[i]);
24 
25  BOOST_TEST(parsed[0].first == "a");
26  BOOST_TEST(parsed[0].second == "p1");
27  BOOST_TEST(parsed[1].first == "b");
28  BOOST_TEST(parsed[1].second == "p2");
29  BOOST_TEST(parsed[2].first == "");
30  BOOST_TEST(parsed[2].second == "c");
31  BOOST_TEST(parsed[3].first == "ddd");
32  BOOST_TEST(parsed[3].second == "p3");
33  BOOST_TEST(parsed[4].first == "eee");
34  BOOST_TEST(parsed[4].second == "p4");
35 }
36 
37 BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(parse_path_spec_t)
Definition: PathSpec_t.cc:12
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:85
std::pair< std::string, std::string > split_process_and_path_names(std::string path_spec)
Definition: PathSpec.cc:11