diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-16 00:43:18 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-16 00:43:18 +0100 |
commit | fae1b7a4eafbd9872d2447eab011bdf9aab97645 (patch) | |
tree | d064da98dff6061bdd74c2734e4f9c7f2f4f51dd /test/core/common/UtilsTest.cpp | |
parent | dbf59a218edd684f93f9cf74cdddd6bebefe15e7 (diff) |
Working on XMLParser (still lot work in progress)
Diffstat (limited to 'test/core/common/UtilsTest.cpp')
-rw-r--r-- | test/core/common/UtilsTest.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/core/common/UtilsTest.cpp b/test/core/common/UtilsTest.cpp index 66458b2..53beb79 100644 --- a/test/core/common/UtilsTest.cpp +++ b/test/core/common/UtilsTest.cpp @@ -40,5 +40,19 @@ TEST(Utils, trim) ASSERT_EQ("hello world", Utils::trim("hello world")); } +TEST(Utils, split) +{ + ASSERT_EQ(std::vector<std::string>({"ab"}), Utils::split("ab", '.')); + ASSERT_EQ(std::vector<std::string>({"a", ""}), Utils::split("a.", '.')); + ASSERT_EQ(std::vector<std::string>({"", ""}), Utils::split(".", '.')); + ASSERT_EQ(std::vector<std::string>({"a", "b"}), Utils::split("a.b", '.')); + ASSERT_EQ(std::vector<std::string>({"a", "b"}), Utils::split("a.b", '.')); + ASSERT_EQ(std::vector<std::string>({"a", "b", "c"}), + Utils::split("a.b.c", '.')); + ASSERT_EQ(std::vector<std::string>({"", "a", "b", "c"}), + Utils::split(".a.b.c", '.')); + ASSERT_EQ(std::vector<std::string>({"", "a", "be", "c", ""}), + Utils::split(".a.be.c.", '.')); +} } |