diff options
Diffstat (limited to 'base/string_split_unittest.cc')
-rw-r--r-- | base/string_split_unittest.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/base/string_split_unittest.cc b/base/string_split_unittest.cc index 984e6e8..820f74b 100644 --- a/base/string_split_unittest.cc +++ b/base/string_split_unittest.cc @@ -85,7 +85,7 @@ class SplitStringIntoKeyValuePairsTest : public testing::Test { std::vector<std::pair<std::string, std::string> > kv_pairs; }; -TEST_F(SplitStringIntoKeyValuePairsTest, DISABLED_EmptyString) { +TEST_F(SplitStringIntoKeyValuePairsTest, EmptyString) { EXPECT_TRUE(SplitStringIntoKeyValuePairs("", ':', // Key-value delimiters ',', // Key-value pair delims @@ -93,6 +93,18 @@ TEST_F(SplitStringIntoKeyValuePairsTest, DISABLED_EmptyString) { EXPECT_TRUE(kv_pairs.empty()); } +TEST_F(SplitStringIntoKeyValuePairsTest, EmptySecondPair) { + EXPECT_TRUE(SplitStringIntoKeyValuePairs("key1:value1,,key3:value3", + ':', // Key-value delimiters + ',', // Key-value pair delims + &kv_pairs)); + ASSERT_EQ(2U, kv_pairs.size()); + EXPECT_EQ("key1", kv_pairs[0].first); + EXPECT_EQ("value1", kv_pairs[0].second); + EXPECT_EQ("key3", kv_pairs[1].first); + EXPECT_EQ("value3", kv_pairs[1].second); +} + TEST_F(SplitStringIntoKeyValuePairsTest, EmptySecondValue) { EXPECT_FALSE(SplitStringIntoKeyValuePairs("key1:value1 , key2:", ':', // Key-value delimiters |