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

Unified Diff: base/string_split_unittest.cc

Issue 3366011: base: Move SplitStringDontTrim functions from string_util.h to string_split.h (Closed) Base URL: git://git.chromium.org/chromium.git
Patch Set: remove dchecks Created 10 years, 3 months 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_split.cc ('k') | base/string_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_split_unittest.cc
diff --git a/base/string_split_unittest.cc b/base/string_split_unittest.cc
index f696480b60f2a13187435668b0c89383e9119a6c..f3a929d8a1972718961432bc47e45a818f12026f 100644
--- a/base/string_split_unittest.cc
+++ b/base/string_split_unittest.cc
@@ -177,4 +177,22 @@ TEST(SplitStringUsingSubstrTest, TrailingDelimitersSkipped) {
results, ElementsAre("un", "deux", "trois", "quatre", "", "", ""));
}
+TEST(StringSplitTest, StringSplitDontTrim) {
+ std::vector<std::wstring> r;
+
+ SplitStringDontTrim(L"\t\ta\t", L'\t', &r);
+ ASSERT_EQ(4U, r.size());
+ EXPECT_EQ(r[0], L"");
+ EXPECT_EQ(r[1], L"");
+ EXPECT_EQ(r[2], L"a");
+ EXPECT_EQ(r[3], L"");
+ r.clear();
+
+ SplitStringDontTrim(L"\ta\t\nb\tcc", L'\n', &r);
+ ASSERT_EQ(2U, r.size());
+ EXPECT_EQ(r[0], L"\ta\t");
+ EXPECT_EQ(r[1], L"b\tcc");
+ r.clear();
+}
+
} // namespace base
« no previous file with comments | « base/string_split.cc ('k') | base/string_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698