summaryrefslogtreecommitdiff
path: root/Source/UnitTests/Common/StringUtilTest.cpp
diff options
context:
space:
mode:
authorTilka <tilkax@gmail.com>2025-08-10 05:09:25 +0100
committerGitHub <noreply@github.com>2025-08-10 05:09:25 +0100
commita07974e2c3e691bcde34e181c0d25aecbd0081c5 (patch)
tree892505b4b3bc7f44c6daed9bfacbcd33465d6b72 /Source/UnitTests/Common/StringUtilTest.cpp
parent5a6c5e2639578978d230a30fcf2d212cf7ce85b1 (diff)
parentf8b85edd0cdf87c9f9a8507258b7989023d028bf (diff)
Merge pull request #13846 from JoshuaVandaele/better-xcb
Qt: Better wayland detection to enforce xcb
Diffstat (limited to 'Source/UnitTests/Common/StringUtilTest.cpp')
-rw-r--r--Source/UnitTests/Common/StringUtilTest.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/Source/UnitTests/Common/StringUtilTest.cpp b/Source/UnitTests/Common/StringUtilTest.cpp
index 2be462a1b5..28bd150c06 100644
--- a/Source/UnitTests/Common/StringUtilTest.cpp
+++ b/Source/UnitTests/Common/StringUtilTest.cpp
@@ -225,3 +225,34 @@ TEST(StringUtil, SplitPathWindowsPathWithDriveLetter)
EXPECT_EQ(extension, "");
}
#endif
+
+TEST(StringUtil, CaseInsensitiveContains_BasicMatches)
+{
+ EXPECT_TRUE(Common::CaseInsensitiveContains("hello world", "hello"));
+ EXPECT_TRUE(Common::CaseInsensitiveContains("hello world", "world"));
+ EXPECT_TRUE(Common::CaseInsensitiveContains("HELLO WORLD", "hello"));
+ EXPECT_TRUE(Common::CaseInsensitiveContains("HeLLo WoRLd", "WORLD"));
+}
+
+TEST(StringUtil, CaseInsensitiveContains_SubstringNotFound)
+{
+ EXPECT_FALSE(Common::CaseInsensitiveContains("hello world", "hey"));
+}
+
+TEST(StringUtil, CaseInsensitiveContains_EmptyStrings)
+{
+ EXPECT_TRUE(Common::CaseInsensitiveContains("", ""));
+ EXPECT_TRUE(Common::CaseInsensitiveContains("hello", ""));
+ EXPECT_FALSE(Common::CaseInsensitiveContains("", "world"));
+}
+
+TEST(StringUtil, CaseInsensitiveContains_EntireStringMatch)
+{
+ EXPECT_TRUE(Common::CaseInsensitiveContains("Test", "TEST"));
+}
+
+TEST(StringUtil, CaseInsensitiveContains_OverlappingMatches)
+{
+ EXPECT_TRUE(Common::CaseInsensitiveContains("aaaaaa", "aa"));
+ EXPECT_TRUE(Common::CaseInsensitiveContains("ababababa", "bABa"));
+}