Lines Matching refs:Str
109 StringRef Str("hello"); in TEST() local
110 EXPECT_EQ("lo", Str.substr(3)); in TEST()
111 EXPECT_EQ("", Str.substr(100)); in TEST()
112 EXPECT_EQ("hello", Str.substr(0, 100)); in TEST()
113 EXPECT_EQ("o", Str.substr(4, 10)); in TEST()
117 StringRef Str("hello"); in TEST() local
118 EXPECT_EQ("l", Str.slice(2, 3)); in TEST()
119 EXPECT_EQ("ell", Str.slice(1, 4)); in TEST()
120 EXPECT_EQ("llo", Str.slice(2, 100)); in TEST()
121 EXPECT_EQ("", Str.slice(2, 1)); in TEST()
122 EXPECT_EQ("", Str.slice(10, 20)); in TEST()
126 StringRef Str("hello"); in TEST() local
128 Str.split('X')); in TEST()
130 Str.split('e')); in TEST()
132 Str.split('h')); in TEST()
134 Str.split('l')); in TEST()
136 Str.split('o')); in TEST()
139 Str.rsplit('X')); in TEST()
141 Str.rsplit('e')); in TEST()
143 Str.rsplit('h')); in TEST()
145 Str.rsplit('l')); in TEST()
147 Str.rsplit('o')); in TEST()
308 StringRef Str("hello"); in TEST() local
309 EXPECT_TRUE(Str.startswith("")); in TEST()
310 EXPECT_TRUE(Str.startswith("he")); in TEST()
311 EXPECT_FALSE(Str.startswith("helloworld")); in TEST()
312 EXPECT_FALSE(Str.startswith("hi")); in TEST()
316 StringRef Str("heLLo"); in TEST() local
317 EXPECT_TRUE(Str.startswith_lower("")); in TEST()
318 EXPECT_TRUE(Str.startswith_lower("he")); in TEST()
319 EXPECT_TRUE(Str.startswith_lower("hell")); in TEST()
320 EXPECT_TRUE(Str.startswith_lower("HELlo")); in TEST()
321 EXPECT_FALSE(Str.startswith_lower("helloworld")); in TEST()
322 EXPECT_FALSE(Str.startswith_lower("hi")); in TEST()
326 StringRef Str("hello"); in TEST() local
327 EXPECT_TRUE(Str.endswith("")); in TEST()
328 EXPECT_TRUE(Str.endswith("lo")); in TEST()
329 EXPECT_FALSE(Str.endswith("helloworld")); in TEST()
330 EXPECT_FALSE(Str.endswith("worldhello")); in TEST()
331 EXPECT_FALSE(Str.endswith("so")); in TEST()
335 StringRef Str("heLLo"); in TEST() local
336 EXPECT_TRUE(Str.endswith_lower("")); in TEST()
337 EXPECT_TRUE(Str.endswith_lower("lo")); in TEST()
338 EXPECT_TRUE(Str.endswith_lower("LO")); in TEST()
339 EXPECT_TRUE(Str.endswith_lower("ELlo")); in TEST()
340 EXPECT_FALSE(Str.endswith_lower("helloworld")); in TEST()
341 EXPECT_FALSE(Str.endswith_lower("hi")); in TEST()
345 StringRef Str("hello"); in TEST() local
346 EXPECT_EQ(2U, Str.find('l')); in TEST()
347 EXPECT_EQ(StringRef::npos, Str.find('z')); in TEST()
348 EXPECT_EQ(StringRef::npos, Str.find("helloworld")); in TEST()
349 EXPECT_EQ(0U, Str.find("hello")); in TEST()
350 EXPECT_EQ(1U, Str.find("ello")); in TEST()
351 EXPECT_EQ(StringRef::npos, Str.find("zz")); in TEST()
352 EXPECT_EQ(2U, Str.find("ll", 2)); in TEST()
353 EXPECT_EQ(StringRef::npos, Str.find("ll", 3)); in TEST()
354 EXPECT_EQ(0U, Str.find("")); in TEST()
361 EXPECT_EQ(3U, Str.rfind('l')); in TEST()
362 EXPECT_EQ(StringRef::npos, Str.rfind('z')); in TEST()
363 EXPECT_EQ(StringRef::npos, Str.rfind("helloworld")); in TEST()
364 EXPECT_EQ(0U, Str.rfind("hello")); in TEST()
365 EXPECT_EQ(1U, Str.rfind("ello")); in TEST()
366 EXPECT_EQ(StringRef::npos, Str.rfind("zz")); in TEST()
368 EXPECT_EQ(2U, Str.find_first_of('l')); in TEST()
369 EXPECT_EQ(1U, Str.find_first_of("el")); in TEST()
370 EXPECT_EQ(StringRef::npos, Str.find_first_of("xyz")); in TEST()
372 EXPECT_EQ(1U, Str.find_first_not_of('h')); in TEST()
373 EXPECT_EQ(4U, Str.find_first_not_of("hel")); in TEST()
374 EXPECT_EQ(StringRef::npos, Str.find_first_not_of("hello")); in TEST()
376 EXPECT_EQ(3U, Str.find_last_not_of('o')); in TEST()
377 EXPECT_EQ(1U, Str.find_last_not_of("lo")); in TEST()
378 EXPECT_EQ(StringRef::npos, Str.find_last_not_of("helo")); in TEST()
382 StringRef Str("hello"); in TEST() local
383 EXPECT_EQ(2U, Str.count('l')); in TEST()
384 EXPECT_EQ(1U, Str.count('o')); in TEST()
385 EXPECT_EQ(0U, Str.count('z')); in TEST()
386 EXPECT_EQ(0U, Str.count("helloworld")); in TEST()
387 EXPECT_EQ(1U, Str.count("hello")); in TEST()
388 EXPECT_EQ(1U, Str.count("ello")); in TEST()
389 EXPECT_EQ(0U, Str.count("zz")); in TEST()
393 StringRef Str("hello"); in TEST() local
394 EXPECT_EQ(2U, Str.edit_distance("hill")); in TEST()
423 const char *Str; member
440 const char *Str; member
473 bool U8Success = StringRef(Unsigned[i].Str).getAsInteger(0, U8); in TEST()
480 bool U16Success = StringRef(Unsigned[i].Str).getAsInteger(0, U16); in TEST()
487 bool U32Success = StringRef(Unsigned[i].Str).getAsInteger(0, U32); in TEST()
494 bool U64Success = StringRef(Unsigned[i].Str).getAsInteger(0, U64); in TEST()
509 bool S8Success = StringRef(Signed[i].Str).getAsInteger(0, S8); in TEST()
516 bool S16Success = StringRef(Signed[i].Str).getAsInteger(0, S16); in TEST()
523 bool S32Success = StringRef(Signed[i].Str).getAsInteger(0, S32); in TEST()
530 bool S64Success = StringRef(Signed[i].Str).getAsInteger(0, S64); in TEST()