test/raw: Workaround compiler warning
The compiler is smart enough to not let this code compile, but we want
to verify that the runtime exception is caught correctly.
Change-Id: Ieeccef2acf3ec89ecf6f0d8abd222c03dc688136
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/test/raw.cpp b/test/raw.cpp
index cb013b6..0de4c33 100644
--- a/test/raw.cpp
+++ b/test/raw.cpp
@@ -88,7 +88,9 @@
TEST(Extract, TooSmall)
{
- std::string_view s("a");
+ std::string str = "aaaa";
+ str.resize(1);
+ std::string_view s(str);
EXPECT_THROW(extract<int>(s), std::runtime_error);
EXPECT_EQ("a", s);
}