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

Unified Diff: base/string_util_unittest.cc

Issue 3266013: Add unit test for ReplaceStringPlaceholders (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Created 10 years, 4 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_util.h ('k') | no next file » | 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 8a8fc3926fd80c17b7c450ad4051ee93560a2297..b01d44b34994ae6f67d7c9d8b0c72dedf072377a 100644
--- a/base/string_util_unittest.cc
+++ b/base/string_util_unittest.cc
@@ -1013,6 +1013,15 @@ TEST(StringUtilTest, StdStringReplaceStringPlaceholders) {
EXPECT_EQ(formatted, "9aa,8bb,7cc,6dd,5ee,4ff,3gg,2hh,1ii");
}
+TEST(StringUtilTest, ReplaceStringPlaceholdersConsecutiveDollarSigns) {
+ std::vector<std::string> subst;
+ subst.push_back("a");
+ subst.push_back("b");
+ subst.push_back("c");
+ EXPECT_EQ(ReplaceStringPlaceholders("$$1 $$$2 $$$$3", subst, NULL),
eroman 2010/08/31 06:37:06 nit: EXPECT_EQ(expected, actual).
+ "$1 $$2 $$$3");
+}
+
TEST(StringUtilTest, SplitStringAlongWhitespace) {
struct TestData {
const std::wstring input;
« no previous file with comments | « base/string_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698