parse_path_spec_t.cpp
Go to the documentation of this file.
2 
3 #include <cassert>
4 #include <cstddef>
5 #include <string>
6 #include <vector>
7 
8 void
10 {
11  std::string a("noblanks");
12  std::string b("\t no blanks \t");
13 
15  assert(a == b);
16 }
17 
18 void
20 {
21  std::vector<std::string> paths;
22  paths.push_back("a:p1");
23  paths.push_back("b:p2");
24  paths.push_back(" c");
25  paths.push_back("ddd\t:p3");
26  paths.push_back("eee: p4 ");
27 
28  std::vector<std::pair<std::string, std::string>> parsed(paths.size());
29  for (size_t i = 0; i < paths.size(); ++i)
30  art::detail::parse_path_spec(paths[i], parsed[i]);
31 
32  assert(parsed[0].first == "a");
33  assert(parsed[0].second == "p1");
34  assert(parsed[1].first == "b");
35  assert(parsed[1].second == "p2");
36  assert(parsed[2].first == "");
37  assert(parsed[2].second == "c");
38  assert(parsed[3].first == "ddd");
39  assert(parsed[3].second == "p3");
40  assert(parsed[4].first == "eee");
41  assert(parsed[4].second == "p4");
42 }
43 
44 int
46 {
49 }
std::string string
Definition: nybbler.cc:12
int main()
void parse_path_spec(std::string path_spec, std::pair< std::string, std::string > &output)
void remove_whitespace(std::string &)
void test_parse_path_spec()
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
void test_remove_whitespace()
static bool * b
Definition: config.cpp:1043
second_as<> second
Type of time stored in seconds, in double precision.
Definition: spacetime.h:85