copy/tests/basics/driver.cxx
RYAN 67a74bb7bb
Some checks failed
on-push / build-and-test (push) Failing after 7s
wip
2024-09-02 01:43:44 +02:00

36 lines
532 B
C++

#include <sstream>
#include <stdexcept>
#include <libcopy-test/version.hxx>
#include <libcopy-test/copy-test.hxx>
#undef NDEBUG
#include <cassert>
int main ()
{
using namespace std;
using namespace copy_test;
// Basics.
//
{
ostringstream o;
say_hello (o, "World");
assert (o.str () == "Hello, World!\n");
}
// Empty name.
//
try
{
ostringstream o;
say_hello (o, "");
assert (false);
}
catch (const invalid_argument& e)
{
assert (e.what () == string ("empty name"));
}
}