aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/StringRefTest.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2013-10-28 22:42:54 +0000
committerRui Ueyama <ruiu@google.com>2013-10-28 22:42:54 +0000
commitb6decb0a80ab619fce8835d4ea3359c0b7ed95b9 (patch)
tree9100b4d9c822c02b2ad78d06e9154e3f322acd83 /llvm/unittests/ADT/StringRefTest.cpp
parenta3feee2ad64b6604bcb35c27a35307bf470accd1 (diff)
downloadllvm-b6decb0a80ab619fce8835d4ea3359c0b7ed95b9.zip
llvm-b6decb0a80ab619fce8835d4ea3359c0b7ed95b9.tar.gz
llvm-b6decb0a80ab619fce8835d4ea3359c0b7ed95b9.tar.bz2
Add a few tests for StringRef::{start,end}with.
llvm-svn: 193550
Diffstat (limited to 'llvm/unittests/ADT/StringRefTest.cpp')
-rw-r--r--llvm/unittests/ADT/StringRefTest.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/StringRefTest.cpp b/llvm/unittests/ADT/StringRefTest.cpp
index 3cb6143..07fba49 100644
--- a/llvm/unittests/ADT/StringRefTest.cpp
+++ b/llvm/unittests/ADT/StringRefTest.cpp
@@ -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"));