Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2778)

Unified Diff: base/string_util_unittest.cc

Issue 5004002: base: Move StringSplitAlongWhitespace to string_split.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unittests Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/string_util.cc ('k') | chrome/browser/bookmarks/bookmark_model_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_util_unittest.cc
diff --git a/base/string_util_unittest.cc b/base/string_util_unittest.cc
index 0f7d79ddc8ee8e7ddf331d500c598a242f103e88..b7639bbc99e3af91fa1cee6e1f0981d53169bd99 100644
--- a/base/string_util_unittest.cc
+++ b/base/string_util_unittest.cc
@@ -925,38 +925,6 @@ TEST(StringUtilTest, ReplaceStringPlaceholdersConsecutiveDollarSigns) {
"$1 $$2 $$$3");
}
-TEST(StringUtilTest, SplitStringAlongWhitespace) {
- struct TestData {
- const std::wstring input;
- const size_t expected_result_count;
- const std::wstring output1;
- const std::wstring output2;
- } data[] = {
- { L"a", 1, L"a", L"" },
- { L" ", 0, L"", L"" },
- { L" a", 1, L"a", L"" },
- { L" ab ", 1, L"ab", L"" },
- { L" ab c", 2, L"ab", L"c" },
- { L" ab c ", 2, L"ab", L"c" },
- { L" ab cd", 2, L"ab", L"cd" },
- { L" ab cd ", 2, L"ab", L"cd" },
- { L" \ta\t", 1, L"a", L"" },
- { L" b\ta\t", 2, L"b", L"a" },
- { L" b\tat", 2, L"b", L"at" },
- { L"b\tat", 2, L"b", L"at" },
- { L"b\t at", 2, L"b", L"at" },
- };
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(data); ++i) {
- std::vector<std::wstring> results;
- SplitStringAlongWhitespace(data[i].input, &results);
- ASSERT_EQ(data[i].expected_result_count, results.size());
- if (data[i].expected_result_count > 0)
- ASSERT_EQ(data[i].output1, results[0]);
- if (data[i].expected_result_count > 1)
- ASSERT_EQ(data[i].output2, results[1]);
- }
-}
-
TEST(StringUtilTest, MatchPatternTest) {
EXPECT_TRUE(MatchPattern("www.google.com", "*.com"));
EXPECT_TRUE(MatchPattern("www.google.com", "*"));
« no previous file with comments | « base/string_util.cc ('k') | chrome/browser/bookmarks/bookmark_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698