Add CString::Find() with case sensitivity support
This commit is contained in:
1 parent
65f739980d
commit
5507e9a290
3 files changed
+25
No files matched your search
@@ -169,6 +169,16 @@ TEST(StringTest, Equals) {
|
||||
EXPECT_FALSE(CS("ABC").Equals("abc", true)); // deprecated
|
||||
}
|
||||
|
||||
TEST(StringTest, Find) {
|
||||
EXPECT_EQ(CString("Hello, I'm Bob").Find("Hello"), 0u);
|
||||
EXPECT_EQ(CString("Hello, I'm Bob").Find("Hello", CString::CaseInsensitive), 0u);
|
||||
EXPECT_EQ(CString("Hello, I'm Bob").Find("Hello", CString::CaseSensitive), 0u);
|
||||
|
||||
EXPECT_EQ(CString("Hello, I'm Bob").Find("i'm"), 7u);
|
||||
EXPECT_EQ(CString("Hello, I'm Bob").Find("i'm", CString::CaseInsensitive), 7u);
|
||||
EXPECT_EQ(CString("Hello, I'm Bob").Find("i'm", CString::CaseSensitive), CString::npos);
|
||||
}
|
||||
|
||||
TEST(StringTest, StartsWith) {
|
||||
EXPECT_TRUE(CString("Hello, I'm Bob").StartsWith("Hello"));
|
||||
EXPECT_TRUE(CString("Hello, I'm Bob").StartsWith("Hello", CString::CaseInsensitive));
|
||||
|
||||
Reference in new issue
Block a user