1
0
forked from Alepha/Alepha

Relocate StackableStreambuf to IOStreams.

This commit is contained in:
2023-11-10 13:30:08 -05:00
parent 6d8e503562
commit db70cb3b08
10 changed files with 17 additions and 16 deletions

View File

@ -0,0 +1,39 @@
static_assert( __cplusplus > 2020'99 );
#include "../StackableStreambuf.h"
#include <fstream>
#include <Alepha/Testing/test.h>
#include <Alepha/Testing/TableTest.h>
#include <Alepha/Utility/evaluation_helpers.h>
#include <Alepha/word_wrap.h>
namespace
{
using namespace Alepha::Testing::literals::test_literals;;
using Alepha::Testing::TableTest;
}
static auto init= Alepha::Utility::enroll <=[]
{
"Simple stacked wordwrap case."_test <=[]
{
std::ostringstream oss;
oss << Alepha::StartWrap{ 20 };
oss << "First wrapping\n";
oss << Alepha::StartWrap{ 10 };
oss << "Second wrapping\n";
oss << Alepha::EndWrap;
oss << "Third wrapping more than 20\n";
oss << Alepha::EndWrap;
std::ofstream log{ "log.txt" };
log << oss.str();
log.close();
std::cout << oss.str() << std::flush;
assert( oss.str() == "First wrapping\nSecond \nwrapping\nThird wrapping more \nthan 20\n" );
};
};

View File

@ -0,0 +1 @@
unit_test( 0 )