1
0
forked from Alepha/Alepha
Files
Alepha/IOStreams/OutUnixFileBuf.test/0.cc

29 lines
539 B
C++

static_assert( __cplusplus > 2020'99 );
#include "../OutUnixFileBuf.h"
#include <Alepha/Testing/test.h>
#include <Alepha/AutoRAII.h>
#include <unistd.h>
#include <fcntl.h>
#include <Alepha/Utility/evaluation_helpers.h>
auto init= Alepha::Utility::enroll <=[]
{
using namespace Alepha::Testing::exports;
"Can we write to /dev/null?"_test <=[]
{
const auto fd= Alepha::AutoRAII
{
[]{ return open( "/dev/null", O_WRONLY ); },
::close
};
Alepha::IOStreams::OutUnixFileBuf buf{ fd };
std::ostream file{ &buf };
};
};