diff options
Diffstat (limited to 'absl/strings/string_view_test.cc')
-rw-r--r-- | absl/strings/string_view_test.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/absl/strings/string_view_test.cc b/absl/strings/string_view_test.cc index df307ac7cfab..3077d240d17b 100644 --- a/absl/strings/string_view_test.cc +++ b/absl/strings/string_view_test.cc @@ -684,8 +684,11 @@ TEST(StringViewTest, TruncSubstr) { } TEST(StringViewTest, UTF8) { - EXPECT_EQ(strlen("á"), absl::string_view("á á").find_first_of(" ")); - EXPECT_EQ(strlen("á"), absl::string_view("á á").find_first_of(" \t")); + std::string utf8 = "\u00E1"; + std::string utf8_twice = utf8 + " " + utf8; + int utf8_len = strlen(utf8.data()); + EXPECT_EQ(utf8_len, absl::string_view(utf8_twice).find_first_of(" ")); + EXPECT_EQ(utf8_len, absl::string_view(utf8_twice).find_first_of(" \t")); } TEST(StringViewTest, FindConformance) { |