diff options
Diffstat (limited to 'absl/strings/str_cat_test.cc')
-rw-r--r-- | absl/strings/str_cat_test.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/absl/strings/str_cat_test.cc b/absl/strings/str_cat_test.cc index 293d1943b16e..dd063b015b63 100644 --- a/absl/strings/str_cat_test.cc +++ b/absl/strings/str_cat_test.cc @@ -300,6 +300,12 @@ TEST(StrAppend, Basics) { "World" }; + std::string stdstrs[] = { + "std::Hello", + "std::Cruel", + "std::World" + }; + absl::string_view pieces[] = {"Hello", "Cruel", "World"}; const char* c_strs[] = { @@ -324,12 +330,12 @@ TEST(StrAppend, Basics) { EXPECT_EQ(result.substr(old_size), "CruelWorld"); old_size = result.size(); - absl::StrAppend(&result, strs[0], ", ", pieces[2]); - EXPECT_EQ(result.substr(old_size), "Hello, World"); + absl::StrAppend(&result, stdstrs[0], ", ", pieces[2]); + EXPECT_EQ(result.substr(old_size), "std::Hello, World"); old_size = result.size(); - absl::StrAppend(&result, strs[0], ", ", strs[1], " ", strs[2], "!"); - EXPECT_EQ(result.substr(old_size), "Hello, Cruel World!"); + absl::StrAppend(&result, strs[0], ", ", stdstrs[1], " ", strs[2], "!"); + EXPECT_EQ(result.substr(old_size), "Hello, std::Cruel World!"); old_size = result.size(); absl::StrAppend(&result, pieces[0], ", ", pieces[1], " ", pieces[2]); |