Lines Matching refs:android

27   std::vector<std::string> parts = android::base::Split("", ",");  in TEST()
33 std::vector<std::string> parts = android::base::Split("foo", ","); in TEST()
39 std::vector<std::string> parts = android::base::Split("foo,bar,baz", ","); in TEST()
47 std::vector<std::string> parts = android::base::Split("foo,,bar", ","); in TEST()
55 std::vector<std::string> parts = android::base::Split("foo,bar,", ","); in TEST()
64 android::base::Split(std::string("foo\0bar", 7), std::string("\0", 1)); in TEST()
71 std::vector<std::string> parts = android::base::Split("foo:bar,baz", ",:"); in TEST()
79 std::vector<std::string> parts = android::base::Split("foo:,bar", ",:"); in TEST()
87 ASSERT_EQ("", android::base::Trim("")); in TEST()
91 ASSERT_EQ("foo", android::base::Trim("foo")); in TEST()
95 ASSERT_EQ("foo", android::base::Trim(" foo")); in TEST()
99 ASSERT_EQ("foo", android::base::Trim("foo ")); in TEST()
103 ASSERT_EQ("foo", android::base::Trim(" foo ")); in TEST()
107 ASSERT_EQ("foo bar", android::base::Trim("foo bar")); in TEST()
111 ASSERT_EQ("foo", android::base::Trim("\v\tfoo\n\f")); in TEST()
116 ASSERT_EQ("", android::base::Join(list, ',')); in TEST()
121 ASSERT_EQ("foo", android::base::Join(list, ',')); in TEST()
126 ASSERT_EQ("foo,bar,baz", android::base::Join(list, ',')); in TEST()
131 ASSERT_EQ(",,,", android::base::Join(list, ',')); in TEST()
136 ASSERT_EQ("1,2,3", android::base::Join(list, ',')); in TEST()
141 ASSERT_TRUE("1,2" == android::base::Join(list, ',') || in TEST()
142 "2,1" == android::base::Join(list, ',')); in TEST()
146 ASSERT_FALSE(android::base::StartsWith("", "foo")); in TEST()
147 ASSERT_TRUE(android::base::StartsWith("", "")); in TEST()
151 ASSERT_FALSE(android::base::StartsWithIgnoreCase("", "foo")); in TEST()
152 ASSERT_TRUE(android::base::StartsWithIgnoreCase("", "")); in TEST()
156 ASSERT_TRUE(android::base::StartsWith("foo", "")); in TEST()
157 ASSERT_TRUE(android::base::StartsWith("foo", "f")); in TEST()
158 ASSERT_TRUE(android::base::StartsWith("foo", "fo")); in TEST()
159 ASSERT_TRUE(android::base::StartsWith("foo", "foo")); in TEST()
163 ASSERT_TRUE(android::base::StartsWithIgnoreCase("foo", "")); in TEST()
164 ASSERT_TRUE(android::base::StartsWithIgnoreCase("foo", "f")); in TEST()
165 ASSERT_TRUE(android::base::StartsWithIgnoreCase("foo", "F")); in TEST()
166 ASSERT_TRUE(android::base::StartsWithIgnoreCase("foo", "fo")); in TEST()
167 ASSERT_TRUE(android::base::StartsWithIgnoreCase("foo", "fO")); in TEST()
168 ASSERT_TRUE(android::base::StartsWithIgnoreCase("foo", "Fo")); in TEST()
169 ASSERT_TRUE(android::base::StartsWithIgnoreCase("foo", "FO")); in TEST()
170 ASSERT_TRUE(android::base::StartsWithIgnoreCase("foo", "foo")); in TEST()
171 ASSERT_TRUE(android::base::StartsWithIgnoreCase("foo", "foO")); in TEST()
172 ASSERT_TRUE(android::base::StartsWithIgnoreCase("foo", "fOo")); in TEST()
173 ASSERT_TRUE(android::base::StartsWithIgnoreCase("foo", "fOO")); in TEST()
174 ASSERT_TRUE(android::base::StartsWithIgnoreCase("foo", "Foo")); in TEST()
175 ASSERT_TRUE(android::base::StartsWithIgnoreCase("foo", "FoO")); in TEST()
176 ASSERT_TRUE(android::base::StartsWithIgnoreCase("foo", "FOo")); in TEST()
177 ASSERT_TRUE(android::base::StartsWithIgnoreCase("foo", "FOO")); in TEST()
181 ASSERT_FALSE(android::base::StartsWith("foo", "foobar")); in TEST()
185 ASSERT_FALSE(android::base::StartsWithIgnoreCase("foo", "foobar")); in TEST()
186 ASSERT_FALSE(android::base::StartsWithIgnoreCase("foo", "FOOBAR")); in TEST()
190 ASSERT_FALSE(android::base::StartsWith("foobar", "oba")); in TEST()
191 ASSERT_FALSE(android::base::StartsWith("foobar", "bar")); in TEST()
195 ASSERT_FALSE(android::base::StartsWithIgnoreCase("foobar", "oba")); in TEST()
196 ASSERT_FALSE(android::base::StartsWithIgnoreCase("foobar", "OBA")); in TEST()
197 ASSERT_FALSE(android::base::StartsWithIgnoreCase("foobar", "bar")); in TEST()
198 ASSERT_FALSE(android::base::StartsWithIgnoreCase("foobar", "BAR")); in TEST()
202 ASSERT_FALSE(android::base::StartsWith("", 'f')); in TEST()
203 ASSERT_TRUE(android::base::StartsWith("foo", 'f')); in TEST()
204 ASSERT_FALSE(android::base::StartsWith("foo", 'o')); in TEST()
208 ASSERT_FALSE(android::base::EndsWith("", "foo")); in TEST()
209 ASSERT_TRUE(android::base::EndsWith("", "")); in TEST()
213 ASSERT_FALSE(android::base::EndsWithIgnoreCase("", "foo")); in TEST()
214 ASSERT_FALSE(android::base::EndsWithIgnoreCase("", "FOO")); in TEST()
215 ASSERT_TRUE(android::base::EndsWithIgnoreCase("", "")); in TEST()
219 ASSERT_TRUE(android::base::EndsWith("foo", "")); in TEST()
220 ASSERT_TRUE(android::base::EndsWith("foo", "o")); in TEST()
221 ASSERT_TRUE(android::base::EndsWith("foo", "oo")); in TEST()
222 ASSERT_TRUE(android::base::EndsWith("foo", "foo")); in TEST()
226 ASSERT_TRUE(android::base::EndsWithIgnoreCase("foo", "")); in TEST()
227 ASSERT_TRUE(android::base::EndsWithIgnoreCase("foo", "o")); in TEST()
228 ASSERT_TRUE(android::base::EndsWithIgnoreCase("foo", "O")); in TEST()
229 ASSERT_TRUE(android::base::EndsWithIgnoreCase("foo", "oo")); in TEST()
230 ASSERT_TRUE(android::base::EndsWithIgnoreCase("foo", "oO")); in TEST()
231 ASSERT_TRUE(android::base::EndsWithIgnoreCase("foo", "Oo")); in TEST()
232 ASSERT_TRUE(android::base::EndsWithIgnoreCase("foo", "OO")); in TEST()
233 ASSERT_TRUE(android::base::EndsWithIgnoreCase("foo", "foo")); in TEST()
234 ASSERT_TRUE(android::base::EndsWithIgnoreCase("foo", "foO")); in TEST()
235 ASSERT_TRUE(android::base::EndsWithIgnoreCase("foo", "fOo")); in TEST()
236 ASSERT_TRUE(android::base::EndsWithIgnoreCase("foo", "fOO")); in TEST()
237 ASSERT_TRUE(android::base::EndsWithIgnoreCase("foo", "Foo")); in TEST()
238 ASSERT_TRUE(android::base::EndsWithIgnoreCase("foo", "FoO")); in TEST()
239 ASSERT_TRUE(android::base::EndsWithIgnoreCase("foo", "FOo")); in TEST()
240 ASSERT_TRUE(android::base::EndsWithIgnoreCase("foo", "FOO")); in TEST()
244 ASSERT_FALSE(android::base::EndsWith("foo", "foobar")); in TEST()
248 ASSERT_FALSE(android::base::EndsWithIgnoreCase("foo", "foobar")); in TEST()
249 ASSERT_FALSE(android::base::EndsWithIgnoreCase("foo", "FOOBAR")); in TEST()
253 ASSERT_FALSE(android::base::EndsWith("foobar", "oba")); in TEST()
254 ASSERT_FALSE(android::base::EndsWith("foobar", "foo")); in TEST()
258 ASSERT_FALSE(android::base::EndsWithIgnoreCase("foobar", "OBA")); in TEST()
259 ASSERT_FALSE(android::base::EndsWithIgnoreCase("foobar", "FOO")); in TEST()
263 ASSERT_TRUE(android::base::StartsWith("hello", std::string{"hell"})); in TEST()
264 ASSERT_FALSE(android::base::StartsWith("goodbye", std::string{"hell"})); in TEST()
268 ASSERT_TRUE(android::base::StartsWithIgnoreCase("HeLlO", std::string{"hell"})); in TEST()
269 ASSERT_FALSE(android::base::StartsWithIgnoreCase("GoOdByE", std::string{"hell"})); in TEST()
273 ASSERT_TRUE(android::base::EndsWith("hello", std::string{"lo"})); in TEST()
274 ASSERT_FALSE(android::base::EndsWith("goodbye", std::string{"lo"})); in TEST()
278 ASSERT_TRUE(android::base::EndsWithIgnoreCase("HeLlO", std::string{"lo"})); in TEST()
279 ASSERT_FALSE(android::base::EndsWithIgnoreCase("GoOdByE", std::string{"lo"})); in TEST()
283 ASSERT_FALSE(android::base::EndsWith("", 'o')); in TEST()
284 ASSERT_TRUE(android::base::EndsWith("foo", 'o')); in TEST()
285 ASSERT_FALSE(android::base::EndsWith("foo", "f")); in TEST()
289 ASSERT_TRUE(android::base::EqualsIgnoreCase("foo", "FOO")); in TEST()
290 ASSERT_TRUE(android::base::EqualsIgnoreCase("FOO", "foo")); in TEST()
291 ASSERT_FALSE(android::base::EqualsIgnoreCase("foo", "bar")); in TEST()
292 ASSERT_FALSE(android::base::EqualsIgnoreCase("foo", "fool")); in TEST()
296 android::base::Split("/dev/null", ":"); in TEST()
301 ASSERT_FALSE(android::base::ConsumePrefix(&s, "bar.")); in TEST()
303 ASSERT_TRUE(android::base::ConsumePrefix(&s, "foo.")); in TEST()
309 ASSERT_FALSE(android::base::ConsumeSuffix(&s, ".foo")); in TEST()
311 ASSERT_TRUE(android::base::ConsumeSuffix(&s, ".bar")); in TEST()
317 ASSERT_EQ("abcabc", android::base::StringReplace("abcabc", "z", "Z", false)); in TEST()
318 ASSERT_EQ("", android::base::StringReplace("", "z", "Z", false)); in TEST()
319 ASSERT_EQ("abcabc", android::base::StringReplace("abcabc", "", "Z", false)); in TEST()
322 ASSERT_EQ("Abcabc", android::base::StringReplace("abcabc", "a", "A", false)); in TEST()
323 ASSERT_EQ("aBcabc", android::base::StringReplace("abcabc", "b", "B", false)); in TEST()
324 ASSERT_EQ("abCabc", android::base::StringReplace("abcabc", "c", "C", false)); in TEST()
327 ASSERT_EQ("foobcabc", android::base::StringReplace("abcabc", "a", "foo", false)); in TEST()
328 ASSERT_EQ("afoocabc", android::base::StringReplace("abcabc", "b", "foo", false)); in TEST()
329 ASSERT_EQ("abfooabc", android::base::StringReplace("abcabc", "c", "foo", false)); in TEST()
332 ASSERT_EQ("xxyz", android::base::StringReplace("abcxyz", "abc", "x", false)); in TEST()
333 ASSERT_EQ("axyz", android::base::StringReplace("abcxyz", "bcx", "x", false)); in TEST()
334 ASSERT_EQ("abcx", android::base::StringReplace("abcxyz", "xyz", "x", false)); in TEST()
339 ASSERT_EQ("abcabc", android::base::StringReplace("abcabc", "z", "Z", true)); in TEST()
340 ASSERT_EQ("", android::base::StringReplace("", "z", "Z", true)); in TEST()
341 ASSERT_EQ("abcabc", android::base::StringReplace("abcabc", "", "Z", true)); in TEST()
344 ASSERT_EQ("AbcAbc", android::base::StringReplace("abcabc", "a", "A", true)); in TEST()
345 ASSERT_EQ("aBcaBc", android::base::StringReplace("abcabc", "b", "B", true)); in TEST()
346 ASSERT_EQ("abCabC", android::base::StringReplace("abcabc", "c", "C", true)); in TEST()
349 ASSERT_EQ("foobcfoobc", android::base::StringReplace("abcabc", "a", "foo", true)); in TEST()
350 ASSERT_EQ("afoocafooc", android::base::StringReplace("abcabc", "b", "foo", true)); in TEST()
351 ASSERT_EQ("abfooabfoo", android::base::StringReplace("abcabc", "c", "foo", true)); in TEST()
354 ASSERT_EQ("xxyzx", android::base::StringReplace("abcxyzabc", "abc", "x", true)); in TEST()
355 ASSERT_EQ("<xx>", android::base::StringReplace("<abcabc>", "abc", "x", true)); in TEST()