summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/StringRefTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/ADT/StringRefTest.cpp')
-rw-r--r--llvm/unittests/ADT/StringRefTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/StringRefTest.cpp b/llvm/unittests/ADT/StringRefTest.cpp
index e7498cca1b0..972201c1ff0 100644
--- a/llvm/unittests/ADT/StringRefTest.cpp
+++ b/llvm/unittests/ADT/StringRefTest.cpp
@@ -87,6 +87,13 @@ TEST(StringRefTest, Utilities) {
raw_string_ostream OS(Storage);
OS << StringRef("hello");
EXPECT_EQ("hello", OS.str());
+
+ EXPECT_TRUE(Str.find('l') == 2);
+ EXPECT_TRUE(Str.find('z') == StringRef::npos);
+ EXPECT_TRUE(Str.find("helloworld") == StringRef::npos);
+ EXPECT_TRUE(Str.find("hello") == 0);
+ EXPECT_TRUE(Str.find("ello") == 1);
+ EXPECT_TRUE(Str.find("zz") == StringRef::npos);
}
} // end anonymous namespace
OpenPOWER on IntegriCloud