1
0
forked from Alepha/Alepha

List delimiting primitive for output streams.

This commit is contained in:
2024-04-03 15:53:43 -04:00
parent 8bd9852bd4
commit 66e8acfd5b
5 changed files with 159 additions and 0 deletions

35
delimited_list.test/0.cc Normal file
View File

@ -0,0 +1,35 @@
static_assert( __cplusplus > 2020'99 );
#include "../delimited_list.h"
#include <Alepha/Testing/test.h>
#include <Alepha/Testing/TableTest.h>
#include <Alepha/Utility/evaluation_helpers.h>
static auto init= Alepha::Utility::enroll <=[]
{
using namespace Alepha::Testing::literals;
using namespace std::literals::string_literals;
using namespace Alepha::Testing::exports;
"Simple Comma Testing"_test <=TableTest
<
[]( std::vector< std::string > names )
{
std::ostringstream oss;
oss << Alepha::StartDelimitedList{ ", "s };
for( const auto &name: names )
{
oss << Alepha::NextItem << name;
}
return oss.str();
}
>
::Cases
{
{ "Simple", { { "Alpha", "Bravo", "Charlie", "Delta", "Echo" } }, "Alpha, Bravo, Charlie, Delta, Echo" },
};
};

View File

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