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.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/absl/strings/str_cat_test.cc b/absl/strings/str_cat_test.cc
index 7f52e053..66eddf0d 100644
--- a/absl/strings/str_cat_test.cc
+++ b/absl/strings/str_cat_test.cc
@@ -665,4 +665,20 @@ TEST(StrCat, AbslStringifyWithEnum) {
EXPECT_EQ(absl::StrCat(e), "Choices");
}
+template <typename Integer>
+void CheckSingleArgumentIntegerLimits() {
+ Integer max = std::numeric_limits<Integer>::max();
+ Integer min = std::numeric_limits<Integer>::min();
+
+ EXPECT_EQ(absl::StrCat(max), std::to_string(max));
+ EXPECT_EQ(absl::StrCat(min), std::to_string(min));
+}
+
+TEST(StrCat, SingleArgumentLimits) {
+ CheckSingleArgumentIntegerLimits<int32_t>();
+ CheckSingleArgumentIntegerLimits<uint32_t>();
+ CheckSingleArgumentIntegerLimits<int64_t>();
+ CheckSingleArgumentIntegerLimits<uint64_t>();
+}
+
} // namespace