diff --git a/projects/SelfTest/ToStringPair.cpp b/projects/SelfTest/ToStringPair.cpp index 355cf1d1..df508092 100644 --- a/projects/SelfTest/ToStringPair.cpp +++ b/projects/SelfTest/ToStringPair.cpp @@ -31,3 +31,22 @@ TEST_CASE( "pair > -> toString", "[t std::pair pair( left, right ); REQUIRE( Catch::toString( pair ) == "{ { 42, \"Arthur\" }, { \"Ford\", 24 } }" ); } + +// More contrivance: A pair of vectors... +TEST_CASE( "toString( pair )", "[toString][pair][vector]" ) +{ + typedef std::pair,std::vector > type; + + int aint[] = { 4, 2 }; + std::vector vint( std::begin(aint), std::end(aint) ); + CHECK( "{ 4, 2 }" == Catch::toString(vint) ); + + float afloat[] = { 0.4f, 0.2f }; + std::vector vfloat( std::begin(afloat), std::end(afloat) ); + CHECK( "{ 0.4f, 0.2f }" == Catch::toString(vfloat) ); + + type value( vint, vfloat ); + CHECK( "{ { 4, 2 }, { 0.4f, 0.2f } }" == Catch::toString(value) ); +} + +