libcruft-util/test/stream.cpp
Danny Robson f6056153e3 rename root namespace from util to cruft
This places, at long last, the core library code into the same namespace
as the extended library code.
2018-08-05 14:42:02 +10:00

42 lines
809 B
C++

#include "../tap.hpp"
#include "../stream.hpp"
#include <sstream>
///////////////////////////////////////////////////////////////////////////////
template <typename T>
void
test_scoped (cruft::TAP::logger&);
//-----------------------------------------------------------------------------
template <>
void
test_scoped<cruft::stream::scoped::flags> (cruft::TAP::logger &tap)
{
std::ostringstream os;
{
cruft::stream::scoped::flags f (os);
os << std::hex;
}
os << 15;
tap.expect_eq (os.str (), "15", "stream::scoped::flag reverts std::hex");
}
///////////////////////////////////////////////////////////////////////////////
int
main (int, char **)
{
cruft::TAP::logger tap;
test_scoped<cruft::stream::scoped::flags> (tap);
return tap.status ();
}