diff options
Diffstat (limited to 'absl/strings/match_test.cc')
-rw-r--r-- | absl/strings/match_test.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/absl/strings/match_test.cc b/absl/strings/match_test.cc index d194f0e6..c21e00bf 100644 --- a/absl/strings/match_test.cc +++ b/absl/strings/match_test.cc @@ -80,6 +80,17 @@ TEST(MatchTest, ContainsNull) { EXPECT_FALSE(absl::StrContains(cs, sv2)); } +TEST(MatchTest, EqualsIgnoreCase) { + std::string text = "the"; + absl::string_view data(text); + + EXPECT_TRUE(absl::EqualsIgnoreCase(data, "The")); + EXPECT_TRUE(absl::EqualsIgnoreCase(data, "THE")); + EXPECT_TRUE(absl::EqualsIgnoreCase(data, "the")); + EXPECT_FALSE(absl::EqualsIgnoreCase(data, "Quick")); + EXPECT_FALSE(absl::EqualsIgnoreCase(data, "then")); +} + TEST(MatchTest, StartsWithIgnoreCase) { EXPECT_TRUE(absl::StartsWithIgnoreCase("foo", "foo")); EXPECT_TRUE(absl::StartsWithIgnoreCase("foo", "Fo")); |