Lines Matching refs:str

44   StringPiece str("hello there!");  in TEST()  local
45 EXPECT_TRUE(ConsumePrefix(&str, "hello ")); in TEST()
46 EXPECT_EQ(str.ToString(), "there!"); in TEST()
47 EXPECT_TRUE(ConsumePrefix(&str, "there")); in TEST()
48 EXPECT_EQ(str.ToString(), "!"); in TEST()
49 EXPECT_FALSE(ConsumePrefix(&str, "!!")); in TEST()
50 EXPECT_TRUE(ConsumePrefix(&str, "")); in TEST()
51 EXPECT_TRUE(ConsumePrefix(&str, "!")); in TEST()
52 EXPECT_EQ(str.ToString(), ""); in TEST()
53 EXPECT_TRUE(ConsumePrefix(&str, "")); in TEST()
54 EXPECT_FALSE(ConsumePrefix(&str, "!")); in TEST()
58 StringPiece str("hello there!"); in TEST() local
59 EXPECT_TRUE(ConsumeSuffix(&str, "!")); in TEST()
60 EXPECT_EQ(str.ToString(), "hello there"); in TEST()
61 EXPECT_TRUE(ConsumeSuffix(&str, " there")); in TEST()
62 EXPECT_EQ(str.ToString(), "hello"); in TEST()
63 EXPECT_FALSE(ConsumeSuffix(&str, "!!")); in TEST()
64 EXPECT_TRUE(ConsumeSuffix(&str, "")); in TEST()
65 EXPECT_TRUE(ConsumeSuffix(&str, "hello")); in TEST()
66 EXPECT_EQ(str.ToString(), ""); in TEST()
67 EXPECT_TRUE(ConsumeSuffix(&str, "")); in TEST()
68 EXPECT_FALSE(ConsumeSuffix(&str, "!")); in TEST()
72 StringPiece str("<hello there!>"); in TEST() local
73 EXPECT_EQ(str.find('<'), 0); in TEST()
74 EXPECT_EQ(str.find('>'), str.length() - 1); in TEST()
75 EXPECT_EQ(str.find('?'), StringPiece::npos); in TEST()
76 EXPECT_EQ(str.find('<', str.length() - 1), StringPiece::npos); in TEST()
77 EXPECT_EQ(str.find('<', 0), 0); in TEST()
78 EXPECT_EQ(str.find('>', str.length() - 1), str.length() - 1); in TEST()
82 StringPiece str("<foo bar baz!>"); in TEST() local
83 EXPECT_EQ(str.find("foo"), 1); in TEST()
84 EXPECT_EQ(str.find("bar"), 5); in TEST()
85 EXPECT_EQ(str.find("baz"), 9); in TEST()
86 EXPECT_EQ(str.find("qux"), StringPiece::npos); in TEST()
87 EXPECT_EQ(str.find("?"), StringPiece::npos); in TEST()
88 EXPECT_EQ(str.find(">"), str.length() - 1); in TEST()
89 EXPECT_EQ(str.find("<", str.length() - 1), StringPiece::npos); in TEST()
90 EXPECT_EQ(str.find("<", 0), 0); in TEST()
91 EXPECT_EQ(str.find(">", str.length() - 1), str.length() - 1); in TEST()