mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-27 04:18:42 +00:00
Change StringRef::startswith and StringRef::endswith to versions which are a
bit more verbose, but optimize to much shorter code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91817 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
1 parent
65f067fa63
commit
d5b1f8a842
2 files changed
+12
-2
No files matched your search
@@ -198,6 +198,14 @@ TEST(StringRefTest, StartsWith) {
|
||||
EXPECT_FALSE(Str.startswith("hi"));
|
||||
}
|
||||
|
||||
TEST(StringRefTest, EndsWith) {
|
||||
StringRef Str("hello");
|
||||
EXPECT_TRUE(Str.endswith("lo"));
|
||||
EXPECT_FALSE(Str.endswith("helloworld"));
|
||||
EXPECT_FALSE(Str.endswith("worldhello"));
|
||||
EXPECT_FALSE(Str.endswith("so"));
|
||||
}
|
||||
|
||||
TEST(StringRefTest, Find) {
|
||||
StringRef Str("hello");
|
||||
EXPECT_EQ(2U, Str.find('l'));
|
||||
|
||||
Reference in new issue
Block a user