diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 19:32:09 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-31 19:32:09 +0000 |
commit | 5f522afa610b2e6a3f9d02a66aeae8f7f8ce0e7b (patch) | |
tree | 5bb1d180ee0dc1bbc75b4f287e80c74aa970ef9d /base/string_util_unittest.cc | |
parent | 76bac57bbe748e45b1307ab2bcab009f5645d6b6 (diff) | |
download | chromium_src-5f522afa610b2e6a3f9d02a66aeae8f7f8ce0e7b.zip chromium_src-5f522afa610b2e6a3f9d02a66aeae8f7f8ce0e7b.tar.gz chromium_src-5f522afa610b2e6a3f9d02a66aeae8f7f8ce0e7b.tar.bz2 |
Add unit test for functionality added to ReplaceStringPlaceholders in r57966.
TEST=base_unittests --gtest_filter=StringUtilTest.ReplaceStringPlaceholders*
Review URL: http://codereview.chromium.org/3266013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58047 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/string_util_unittest.cc')
-rw-r--r-- | base/string_util_unittest.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/base/string_util_unittest.cc b/base/string_util_unittest.cc index 7bdacea..b317d83 100644 --- a/base/string_util_unittest.cc +++ b/base/string_util_unittest.cc @@ -1022,6 +1022,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), + "$1 $$2 $$$3"); +} + TEST(StringUtilTest, SplitStringAlongWhitespace) { struct TestData { const std::wstring input; |