| Index: base/string_tokenizer_unittest.cc
|
| ===================================================================
|
| --- base/string_tokenizer_unittest.cc (revision 29282)
|
| +++ base/string_tokenizer_unittest.cc (working copy)
|
| @@ -30,6 +30,28 @@
|
| EXPECT_FALSE(t.GetNext());
|
| }
|
|
|
| +TEST(StringTokenizerTest, Reset) {
|
| + string input = "this is a test";
|
| + StringTokenizer t(input, " ");
|
| +
|
| + for (int i = 0; i < 2; ++i) {
|
| + EXPECT_TRUE(t.GetNext());
|
| + EXPECT_EQ(string("this"), t.token());
|
| +
|
| + EXPECT_TRUE(t.GetNext());
|
| + EXPECT_EQ(string("is"), t.token());
|
| +
|
| + EXPECT_TRUE(t.GetNext());
|
| + EXPECT_EQ(string("a"), t.token());
|
| +
|
| + EXPECT_TRUE(t.GetNext());
|
| + EXPECT_EQ(string("test"), t.token());
|
| +
|
| + EXPECT_FALSE(t.GetNext());
|
| + t.Reset();
|
| + }
|
| +}
|
| +
|
| TEST(StringTokenizerTest, RetDelims) {
|
| string input = "this is a test";
|
| StringTokenizer t(input, " ");
|
|
|