diff options
Diffstat (limited to 'o3tl')
-rw-r--r-- | o3tl/qa/test-string_view.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/o3tl/qa/test-string_view.cxx b/o3tl/qa/test-string_view.cxx index 977cfebc460a..fb6239fca379 100644 --- a/o3tl/qa/test-string_view.cxx +++ b/o3tl/qa/test-string_view.cxx @@ -9,7 +9,9 @@ #include <sal/config.h> +#include <sstream> #include <stdexcept> +#include <string> #include <cppunit/TestAssert.h> #include <cppunit/TestFixture.h> @@ -27,6 +29,7 @@ private: CPPUNIT_TEST(testChar32Literal); CPPUNIT_TEST(testWcharLiteral); CPPUNIT_TEST(testOperations); + CPPUNIT_TEST(testOutput); CPPUNIT_TEST_SUITE_END(); void testCharLiteral() { @@ -203,6 +206,12 @@ private: v.find_last_not_of("fxo", o3tl::string_view::npos, 2)); CPPUNIT_ASSERT_EQUAL(npos, v.find_last_not_of("fxo")); } + + void testOutput() { + std::ostringstream s; + s << o3tl::string_view("foo"); + CPPUNIT_ASSERT_EQUAL(std::string("foo"), s.str()); + } }; CPPUNIT_TEST_SUITE_REGISTRATION(Test); |