diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-02 02:01:48 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-02 02:01:48 +0000 |
commit | e8478ae4ef8bd1dbb83cd46e8af060d5331ba2df (patch) | |
tree | f1b969244d1ffa41c32242429e9218ccd4955fb8 /base/string_util_unittest.cc | |
parent | ee940fc4997e1e0369f8e9fd1cce24311e1945a0 (diff) | |
download | chromium_src-e8478ae4ef8bd1dbb83cd46e8af060d5331ba2df.zip chromium_src-e8478ae4ef8bd1dbb83cd46e8af060d5331ba2df.tar.gz chromium_src-e8478ae4ef8bd1dbb83cd46e8af060d5331ba2df.tar.bz2 |
base: Move SplitStringUsingSubstr functions from string_util.h to string_split.h
BUG=None
TEST=trybots
Review URL: http://codereview.chromium.org/3284005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58300 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/string_util_unittest.cc')
-rw-r--r-- | base/string_util_unittest.cc | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/base/string_util_unittest.cc b/base/string_util_unittest.cc index b317d83..f0524bee 100644 --- a/base/string_util_unittest.cc +++ b/base/string_util_unittest.cc @@ -1230,49 +1230,4 @@ TEST(StringUtilTest, ContainsOnlyChars) { EXPECT_FALSE(ContainsOnlyChars("123a", "4321")); } -TEST(SplitStringUsingSubstrTest, EmptyString) { - std::vector<std::string> results; - SplitStringUsingSubstr("", "DELIMITER", &results); - ASSERT_EQ(1u, results.size()); - EXPECT_THAT(results, ElementsAre("")); -} - -TEST(SplitStringUsingSubstrTest, StringWithNoDelimiter) { - std::vector<std::string> results; - SplitStringUsingSubstr("alongwordwithnodelimiter", "DELIMITER", &results); - ASSERT_EQ(1u, results.size()); - EXPECT_THAT(results, ElementsAre("alongwordwithnodelimiter")); -} - -TEST(SplitStringUsingSubstrTest, LeadingDelimitersSkipped) { - std::vector<std::string> results; - SplitStringUsingSubstr( - "DELIMITERDELIMITERDELIMITERoneDELIMITERtwoDELIMITERthree", - "DELIMITER", - &results); - ASSERT_EQ(6u, results.size()); - EXPECT_THAT(results, ElementsAre("", "", "", "one", "two", "three")); -} - -TEST(SplitStringUsingSubstrTest, ConsecutiveDelimitersSkipped) { - std::vector<std::string> results; - SplitStringUsingSubstr( - "unoDELIMITERDELIMITERDELIMITERdosDELIMITERtresDELIMITERDELIMITERcuatro", - "DELIMITER", - &results); - ASSERT_EQ(7u, results.size()); - EXPECT_THAT(results, ElementsAre("uno", "", "", "dos", "tres", "", "cuatro")); -} - -TEST(SplitStringUsingSubstrTest, TrailingDelimitersSkipped) { - std::vector<std::string> results; - SplitStringUsingSubstr( - "unDELIMITERdeuxDELIMITERtroisDELIMITERquatreDELIMITERDELIMITERDELIMITER", - "DELIMITER", - &results); - ASSERT_EQ(7u, results.size()); - EXPECT_THAT( - results, ElementsAre("un", "deux", "trois", "quatre", "", "", "")); -} - } // namespace base |