Add test for android::base::Split with a trailing empty part.
Test: this new unit test Change-Id: Ia14ba878f2866e333a69f1e6f7f56b66a7e657a5
This commit is contained in:
parent
1c65e77e6d
commit
fbbf27da02
1 changed files with 8 additions and 0 deletions
|
|
@ -51,6 +51,14 @@ TEST(strings, split_with_empty_part) {
|
|||
ASSERT_EQ("bar", parts[2]);
|
||||
}
|
||||
|
||||
TEST(strings, split_with_trailing_empty_part) {
|
||||
std::vector<std::string> parts = android::base::Split("foo,bar,", ",");
|
||||
ASSERT_EQ(3U, parts.size());
|
||||
ASSERT_EQ("foo", parts[0]);
|
||||
ASSERT_EQ("bar", parts[1]);
|
||||
ASSERT_EQ("", parts[2]);
|
||||
}
|
||||
|
||||
TEST(strings, split_null_char) {
|
||||
std::vector<std::string> parts =
|
||||
android::base::Split(std::string("foo\0bar", 7), std::string("\0", 1));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue