diff options
Diffstat (limited to 'base')
-rw-r--r-- | base/strings_test.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/base/strings_test.cpp b/base/strings_test.cpp index 7ed5b2b08..121197cab 100644 --- a/base/strings_test.cpp +++ b/base/strings_test.cpp | |||
@@ -51,6 +51,14 @@ TEST(strings, split_with_empty_part) { | |||
51 | ASSERT_EQ("bar", parts[2]); | 51 | ASSERT_EQ("bar", parts[2]); |
52 | } | 52 | } |
53 | 53 | ||
54 | TEST(strings, split_with_trailing_empty_part) { | ||
55 | std::vector<std::string> parts = android::base::Split("foo,bar,", ","); | ||
56 | ASSERT_EQ(3U, parts.size()); | ||
57 | ASSERT_EQ("foo", parts[0]); | ||
58 | ASSERT_EQ("bar", parts[1]); | ||
59 | ASSERT_EQ("", parts[2]); | ||
60 | } | ||
61 | |||
54 | TEST(strings, split_null_char) { | 62 | TEST(strings, split_null_char) { |
55 | std::vector<std::string> parts = | 63 | std::vector<std::string> parts = |
56 | android::base::Split(std::string("foo\0bar", 7), std::string("\0", 1)); | 64 | android::base::Split(std::string("foo\0bar", 7), std::string("\0", 1)); |