| 1 | // |
|---|---|
| 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) |
| 3 | // |
| 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 6 | // |
| 7 | // Official repository: https://github.com/boostorg/beast |
| 8 | // |
| 9 | |
| 10 | // Test that header file is self-contained. |
| 11 | #include <boost/beast/core/buffers_to_string.hpp> |
| 12 | |
| 13 | #include <boost/beast/core/multi_buffer.hpp> |
| 14 | #include <boost/beast/core/ostream.hpp> |
| 15 | #include <boost/beast/_experimental/unit_test/suite.hpp> |
| 16 | |
| 17 | namespace boost { |
| 18 | namespace beast { |
| 19 | |
| 20 | class buffers_to_string_test : public unit_test::suite |
| 21 | { |
| 22 | public: |
| 23 | void |
| 24 | run() override |
| 25 | { |
| 26 | multi_buffer b; |
| 27 | ostream(buffer&: b) << "Hello, "; |
| 28 | BEAST_EXPECT(buffers_to_string(b.data()) == "Hello, "); |
| 29 | ostream(buffer&: b) << "world!"; |
| 30 | BEAST_EXPECT(buffers_to_string(b.data()) == "Hello, world!"); |
| 31 | } |
| 32 | }; |
| 33 | |
| 34 | BEAST_DEFINE_TESTSUITE(beast,core,buffers_to_string); |
| 35 | |
| 36 | } // beast |
| 37 | } // boost |
| 38 |
