Add split empty string unit test #4933

This commit is contained in:
Jerry (Xinyu Hou) 2015-10-29 15:11:09 -07:00
parent c148fbb7f4
commit 942dcabdcd
1 changed files with 9 additions and 0 deletions

View File

@ -134,6 +134,15 @@ TEST(StringTests, splitString_noSeparator_returnOriginalString)
EXPECT_EQ("stub1", results[0]); EXPECT_EQ("stub1", results[0]);
} }
TEST(StringTests, splitString_emptyString_returnEmptyVector)
{
String string;
std::vector<String> results = string::splitString(string, ':');
EXPECT_EQ(0, results.size());
}
TEST(StringTests, splitString_tailSeparator_returnTwoParts) TEST(StringTests, splitString_tailSeparator_returnTwoParts)
{ {
String string = "stub1:stub2:"; String string = "stub1:stub2:";