forked from Alepha/Alepha
List delimiting primitive for output streams.
This commit is contained in:
35
delimited_list.test/0.cc
Normal file
35
delimited_list.test/0.cc
Normal 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" },
|
||||
};
|
||||
};
|
1
delimited_list.test/CMakeLists.txt
Normal file
1
delimited_list.test/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
||||
unit_test( 0 )
|
Reference in New Issue
Block a user