mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-27 06:48:33 +00:00
Common: Replace StringBeginsWith/StringEndsWith with std equivalents
Obsoletes these functions in favor of the standard member functions added in C++20.
This commit is contained in:
parent
ba6ee9d7ba
commit
e5b91f00b0
21 changed files with 57 additions and 97 deletions
|
@ -16,30 +16,6 @@ TEST(StringUtil, JoinStrings)
|
|||
EXPECT_EQ("???", JoinStrings({"?", "?"}, "?"));
|
||||
}
|
||||
|
||||
TEST(StringUtil, StringBeginsWith)
|
||||
{
|
||||
EXPECT_TRUE(StringBeginsWith("abc", "a"));
|
||||
EXPECT_FALSE(StringBeginsWith("abc", "b"));
|
||||
EXPECT_TRUE(StringBeginsWith("abc", "ab"));
|
||||
EXPECT_FALSE(StringBeginsWith("a", "ab"));
|
||||
EXPECT_FALSE(StringBeginsWith("", "a"));
|
||||
EXPECT_FALSE(StringBeginsWith("", "ab"));
|
||||
EXPECT_TRUE(StringBeginsWith("abc", ""));
|
||||
EXPECT_TRUE(StringBeginsWith("", ""));
|
||||
}
|
||||
|
||||
TEST(StringUtil, StringEndsWith)
|
||||
{
|
||||
EXPECT_TRUE(StringEndsWith("abc", "c"));
|
||||
EXPECT_FALSE(StringEndsWith("abc", "b"));
|
||||
EXPECT_TRUE(StringEndsWith("abc", "bc"));
|
||||
EXPECT_FALSE(StringEndsWith("a", "ab"));
|
||||
EXPECT_FALSE(StringEndsWith("", "a"));
|
||||
EXPECT_FALSE(StringEndsWith("", "ab"));
|
||||
EXPECT_TRUE(StringEndsWith("abc", ""));
|
||||
EXPECT_TRUE(StringEndsWith("", ""));
|
||||
}
|
||||
|
||||
TEST(StringUtil, StringPopBackIf)
|
||||
{
|
||||
std::string abc = "abc";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue