Add a few tests for StringRef::{start,end}with.

llvm-svn: 193550
This commit is contained in:
Rui Ueyama 2013-10-28 22:42:54 +00:00
parent a3feee2ad6
commit b6decb0a80
1 changed files with 2 additions and 0 deletions

View File

@ -248,6 +248,7 @@ TEST(StringRefTest, Trim) {
TEST(StringRefTest, StartsWith) {
StringRef Str("hello");
EXPECT_TRUE(Str.startswith(""));
EXPECT_TRUE(Str.startswith("he"));
EXPECT_FALSE(Str.startswith("helloworld"));
EXPECT_FALSE(Str.startswith("hi"));
@ -255,6 +256,7 @@ TEST(StringRefTest, StartsWith) {
TEST(StringRefTest, EndsWith) {
StringRef Str("hello");
EXPECT_TRUE(Str.endswith(""));
EXPECT_TRUE(Str.endswith("lo"));
EXPECT_FALSE(Str.endswith("helloworld"));
EXPECT_FALSE(Str.endswith("worldhello"));