summaryrefslogtreecommitdiff
path: root/absl/strings/str_cat_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'absl/strings/str_cat_test.cc')
-rw-r--r--absl/strings/str_cat_test.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/absl/strings/str_cat_test.cc b/absl/strings/str_cat_test.cc
index beb15fa9..1f1051d4 100644
--- a/absl/strings/str_cat_test.cc
+++ b/absl/strings/str_cat_test.cc
@@ -18,6 +18,7 @@
#include <cstdint>
#include <string>
+#include <vector>
#include "gtest/gtest.h"
#include "absl/strings/substitute.h"
@@ -395,6 +396,18 @@ TEST(StrAppend, Basics) {
"No limit thanks to C++11's variadic templates");
}
+TEST(StrCat, VectorBoolReferenceTypes) {
+ std::vector<bool> v;
+ v.push_back(true);
+ v.push_back(false);
+ std::vector<bool> const& cv = v;
+ // Test that vector<bool>::reference and vector<bool>::const_reference
+ // are handled as if the were really bool types and not the proxy types
+ // they really are.
+ std::string result = absl::StrCat(v[0], v[1], cv[0], cv[1]); // NOLINT
+ EXPECT_EQ(result, "1010");
+}
+
#ifdef GTEST_HAS_DEATH_TEST
TEST(StrAppend, Death) {
std::string s = "self";