summaryrefslogtreecommitdiff
path: root/absl/strings/string_view_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/strings/string_view_test.cc')
-rw-r--r--absl/strings/string_view_test.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/absl/strings/string_view_test.cc b/absl/strings/string_view_test.cc
index df307ac7..3077d240 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) {