Macros | Functions
PathSpec_t.cc File Reference
#include "boost/test/unit_test.hpp"
#include "art/Persistency/Provenance/PathSpec.h"
#include <cstddef>
#include <string>
#include <vector>

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   (PathSpec_t)
 

Functions

 BOOST_AUTO_TEST_CASE (parse_path_spec_t)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (PathSpec_t)

Definition at line 1 of file PathSpec_t.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( parse_path_spec_t  )

Definition at line 12 of file PathSpec_t.cc.

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 }
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