Scheduler
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
stringUtilsTest.cpp
Go to the documentation of this file.
1 
10 #include <string>
11 
12 #include <utils/stringUtils.h>
13 #include <gtest/gtest.h>
14 
15 
16 
17 
18 TEST(stringUtilsTest, split)
19 {
20 
22  std::string none("");
23  std::string string1("string");
24  std::string two("two words");
25 
26  std::vector<std::string> elements = su.split(none, ' ');
27  EXPECT_EQ(0u, elements.size());
28 
29  elements = su.split(string1, ' ');
30  EXPECT_EQ(1u, elements.size());
31  EXPECT_EQ(std::string("string"), elements[0]);
32 
33  elements = su.split(two, ' ');
34  EXPECT_EQ(2u, elements.size());
35  EXPECT_EQ(std::string("two"), elements[0]);
36  EXPECT_EQ(std::string("words"), elements[1]);
37 }
38 
39 
40 
41 
42 
43 
44 
45 
46 
TEST(stringUtilsTest, split)
static std::vector< std::string > split(std::string str, char delimiter)
Definition: stringUtils.cpp:18