| 26 | |
| 27 | template <typename StringWriter, typename String> |
| 28 | void common_tests(StringWriter& writer, const String& output) { |
| 29 | SECTION("InitialState") { |
| 30 | REQUIRE(std::string("") == output); |
| 31 | } |
| 32 | |
| 33 | SECTION("EmptyString") { |
| 34 | REQUIRE(0 == print(writer, "")); |
| 35 | REQUIRE(std::string("") == output); |
| 36 | } |
| 37 | |
| 38 | SECTION("OneString") { |
| 39 | REQUIRE(4 == print(writer, "ABCD")); |
| 40 | REQUIRE("ABCD"_s == output); |
| 41 | } |
| 42 | |
| 43 | SECTION("TwoStrings") { |
| 44 | REQUIRE(4 == print(writer, "ABCD")); |
| 45 | REQUIRE(4 == print(writer, "EFGH")); |
| 46 | REQUIRE("ABCDEFGH"_s == output); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | TEST_CASE("StaticStringWriter") { |
| 51 | char output[20] = {0}; |
no test coverage detected