summaryrefslogtreecommitdiff
path: root/unittests/ADT/StringRefTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/ADT/StringRefTest.cpp')
-rw-r--r--unittests/ADT/StringRefTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/unittests/ADT/StringRefTest.cpp b/unittests/ADT/StringRefTest.cpp
index e7498cca1b..972201c1ff 100644
--- a/unittests/ADT/StringRefTest.cpp
+++ b/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