From e5b91f00b0688d5cba6870da6d6ad3300097b07f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 24 Jan 2023 14:25:49 -0500 Subject: Common: Replace StringBeginsWith/StringEndsWith with std equivalents Obsoletes these functions in favor of the standard member functions added in C++20. --- Source/UnitTests/Common/StringUtilTest.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'Source/UnitTests/Common/StringUtilTest.cpp') diff --git a/Source/UnitTests/Common/StringUtilTest.cpp b/Source/UnitTests/Common/StringUtilTest.cpp index 8cc3590a7c..1f1159d1eb 100644 --- a/Source/UnitTests/Common/StringUtilTest.cpp +++ b/Source/UnitTests/Common/StringUtilTest.cpp @@ -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"; -- cgit v1.2.3