aboutsummaryrefslogtreecommitdiff
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 972201c1ff..ef89e9f3f9 100644
--- a/unittests/ADT/StringRefTest.cpp
+++ b/unittests/ADT/StringRefTest.cpp
@@ -94,6 +94,13 @@ TEST(StringRefTest, Utilities) {
EXPECT_TRUE(Str.find("hello") == 0);
EXPECT_TRUE(Str.find("ello") == 1);
EXPECT_TRUE(Str.find("zz") == StringRef::npos);
+
+ EXPECT_TRUE(Str.count('l') == 2);
+ EXPECT_TRUE(Str.count('z') == 0);
+ EXPECT_TRUE(Str.count("helloworld") == 0);
+ EXPECT_TRUE(Str.count("hello") == 1);
+ EXPECT_TRUE(Str.count("ello") == 1);
+ EXPECT_TRUE(Str.count("zz") == 0);
}
} // end anonymous namespace