#define CATCH_CONFIG_MAIN #include "catch.hpp" class Bits {}; TEST_CASE ("Construction") { CHECK( ( Bits{"0010010"} ) ); } TEST_CASE ("output") { string s {"0010101"}; Bits b {s}; ostringstream oss; oss << b; REQUIRE( s == oss.str() ); } TEST_CASE ("++") { Bits b {"010"}; ostringstream oss; oss << ++b; REQUIRE(oss.str() == "11"); oss.str(""); oss << b++; REQUIRE(oss.str() == "11"); oss.str(""); oss << b; REQUIRE(oss.str() == "100"); }