mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-19 08:35:45 +00:00
StringRef: Add find(char) and find(StringRef).
Also, regroup functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78712 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user