diff --git a/starboard/common/string_test.cc b/starboard/common/string_test.cc index e5f3935c62eb..e8cda0b0b251 100644 --- a/starboard/common/string_test.cc +++ b/starboard/common/string_test.cc @@ -26,7 +26,7 @@ TEST(StringTest, SplitString) { std::string str = "The quick brown fox jumps over the lazy dog"; std::vector output = SplitString(str, '.'); ASSERT_EQ(output.size(), 1); - ASSERT_EQ(output[0], "The quick brown fox jumps over the lazy dog"); + ASSERT_EQ(output[0], str); std::vector vec = {"The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"}; @@ -43,10 +43,19 @@ TEST(StringTest, SplitString) { for (int i = 0; i < vec.size(); ++i) { ASSERT_EQ(output[i], vec[i]); } +} - str = ""; - output = SplitString(str, '.'); - EXPECT_TRUE(output.empty()); +TEST(StringTest, SplitStringEmptyInput) { + std::string str; + std::vector output = SplitString(str, '.'); + ASSERT_TRUE(output.empty()); +} + +TEST(StringTest, SplitStringNullDelimiter) { + std::string str = "The quick brown fox jumps over the lazy dog"; + std::vector output = SplitString(str, '\0'); + ASSERT_EQ(output.size(), 1); + ASSERT_EQ(output[0], str); } } // namespace