Macros | Typedefs | Functions
split_test.cc File Reference
#include "boost/test/unit_test.hpp"
#include "cetlib/split.h"
#include <iterator>
#include <string>
#include <vector>

Go to the source code of this file.

Macros

#define BOOST_TEST_MODULE   (split test)
 

Typedefs

using string_vector = std::vector< std::string >
 

Functions

 BOOST_AUTO_TEST_CASE (empty_string_test)
 
 BOOST_AUTO_TEST_CASE (a_string_test)
 
 BOOST_AUTO_TEST_CASE (a1_string_test)
 
 BOOST_AUTO_TEST_CASE (boo_string_test)
 
 BOOST_AUTO_TEST_CASE (ab_string_test)
 
 BOOST_AUTO_TEST_CASE (ab1_string_test)
 
 BOOST_AUTO_TEST_CASE (split_test_1)
 

Macro Definition Documentation

#define BOOST_TEST_MODULE   (split test)

Definition at line 7 of file split_test.cc.

Typedef Documentation

Definition at line 16 of file split_test.cc.

Function Documentation

BOOST_AUTO_TEST_CASE ( empty_string_test  )

Definition at line 20 of file split_test.cc.

21 {
22  std::string s;
23  std::vector<std::string> v;
24  split(s, ':', std::back_inserter(v));
25  BOOST_TEST(v.size() == 0ul);
26 }
std::string string
Definition: nybbler.cc:12
void split(std::string const &s, char c, OutIter dest)
Definition: split.h:35
static QCString * s
Definition: config.cpp:1042
BOOST_AUTO_TEST_CASE ( a_string_test  )

Definition at line 28 of file split_test.cc.

29 {
30  std::string s("a");
31  std::vector<std::string> v;
32  split(s, ':', std::back_inserter(v));
33  auto ref = {"a"};
34  BOOST_TEST(v == ref, boost::test_tools::per_element{});
35 }
std::string string
Definition: nybbler.cc:12
void split(std::string const &s, char c, OutIter dest)
Definition: split.h:35
static QCString * s
Definition: config.cpp:1042
BOOST_AUTO_TEST_CASE ( a1_string_test  )

Definition at line 37 of file split_test.cc.

38 {
39  std::string s("a:");
40  std::vector<std::string> v;
41  split(s, ':', std::back_inserter(v));
42  auto ref = {"a"};
43  BOOST_TEST(v == ref, boost::test_tools::per_element{});
44 }
std::string string
Definition: nybbler.cc:12
void split(std::string const &s, char c, OutIter dest)
Definition: split.h:35
static QCString * s
Definition: config.cpp:1042
BOOST_AUTO_TEST_CASE ( boo_string_test  )

Definition at line 46 of file split_test.cc.

47 {
48  std::string s(":boo");
49  std::vector<std::string> v;
50  split(s, ':', std::back_inserter(v));
51  auto ref = {"boo"};
52  BOOST_TEST(v == ref, boost::test_tools::per_element{});
53 }
std::string string
Definition: nybbler.cc:12
void split(std::string const &s, char c, OutIter dest)
Definition: split.h:35
static QCString * s
Definition: config.cpp:1042
BOOST_AUTO_TEST_CASE ( ab_string_test  )

Definition at line 55 of file split_test.cc.

56 {
57  std::string s("a:b");
58  std::vector<std::string> v;
59  split(s, ':', std::back_inserter(v));
60  string_vector const expected{"a", "b"};
61  BOOST_TEST(v == expected);
62 }
const char expected[]
Definition: Exception_t.cc:22
std::string string
Definition: nybbler.cc:12
std::vector< std::string > string_vector
void split(std::string const &s, char c, OutIter dest)
Definition: split.h:35
static QCString * s
Definition: config.cpp:1042
BOOST_AUTO_TEST_CASE ( ab1_string_test  )

Definition at line 64 of file split_test.cc.

65 {
66  std::string s("a::b");
67  std::vector<std::string> v;
68  split(s, ':', std::back_inserter(v));
69  string_vector const expected{"a", "b"};
70  BOOST_TEST(v == expected);
71 }
const char expected[]
Definition: Exception_t.cc:22
std::string string
Definition: nybbler.cc:12
std::vector< std::string > string_vector
void split(std::string const &s, char c, OutIter dest)
Definition: split.h:35
static QCString * s
Definition: config.cpp:1042
BOOST_AUTO_TEST_CASE ( split_test_1  )

Definition at line 73 of file split_test.cc.

74 {
75  std::string const s("abc:d::ef");
76  std::vector<std::string> v;
77  split(s, ':', std::back_inserter(v));
78  string_vector const expected{"abc", "d", "ef"};
79  BOOST_TEST(v == expected);
80 }
const char expected[]
Definition: Exception_t.cc:22
std::string string
Definition: nybbler.cc:12
std::vector< std::string > string_vector
void split(std::string const &s, char c, OutIter dest)
Definition: split.h:35
static QCString * s
Definition: config.cpp:1042