Feat update
All checks were successful
linux-x64-gcc / linux-gcc (Debug) (push) Successful in 1m39s
linux-mips64-gcc / linux-gcc-mips64el (push) Successful in 1m14s
linux-x64-gcc / linux-gcc (Release) (push) Successful in 1m42s

This commit is contained in:
tqcq 2024-03-30 17:48:47 +08:00
parent 00f8125757
commit f97c1b7e0b

View File

@ -3,20 +3,16 @@
TEST(ToLower, Char)
{
EXPECT_EQ(sled::ToLower('A'), 'a');
EXPECT_EQ(sled::ToLower('Z'), 'z');
EXPECT_EQ(sled::ToLower('a'), 'a');
EXPECT_EQ(sled::ToLower('z'), 'z');
for (char c = 'A'; c <= 'Z'; ++c) { EXPECT_EQ(sled::ToLower(c), c + 32) << c; }
for (char c = 'a'; c <= 'z'; ++c) { EXPECT_EQ(sled::ToLower(c), c) << c; }
EXPECT_EQ(sled::ToLower(' '), ' ');
EXPECT_EQ(sled::ToLower('\0'), '\0');
}
TEST(ToUpper, Char)
{
EXPECT_EQ(sled::ToUpper('A'), 'A');
EXPECT_EQ(sled::ToUpper('Z'), 'Z');
EXPECT_EQ(sled::ToUpper('a'), 'A');
EXPECT_EQ(sled::ToUpper('z'), 'Z');
for (char c = 'A'; c <= 'Z'; ++c) { EXPECT_EQ(sled::ToUpper(c), c) << c; }
for (char c = 'a'; c <= 'z'; ++c) { EXPECT_EQ(sled::ToUpper(c), c - 32) << c; }
EXPECT_EQ(sled::ToUpper(' '), ' ');
EXPECT_EQ(sled::ToUpper('\0'), '\0');
}