about summary refs log tree commit diff
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.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/absl/strings/string_view_test.cc b/absl/strings/string_view_test.cc
index 2380e1a377a3..22d43536be55 100644
--- a/absl/strings/string_view_test.cc
+++ b/absl/strings/string_view_test.cc
@@ -369,6 +369,11 @@ TEST(StringViewTest, STL1) {
   EXPECT_EQ(buf[1], c[1]);
   EXPECT_EQ(buf[2], c[2]);
   EXPECT_EQ(buf[3], a[3]);
+#ifdef ABSL_HAVE_EXCEPTIONS
+  EXPECT_THROW(a.copy(buf, 1, 27), std::out_of_range);
+#else
+  EXPECT_DEATH(a.copy(buf, 1, 27), "absl::string_view::copy");
+#endif
 }
 
 // Separated from STL1() because some compilers produce an overly