mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 12:17:11 +01:00 
			
		
		
		
	Added test for stringifying std::arrays
This commit is contained in:
		| @@ -1,6 +1,6 @@ | ||||
| #include "catch.hpp" | ||||
| #include <vector> | ||||
|  | ||||
| #include <array> | ||||
|  | ||||
| // vedctor | ||||
| TEST_CASE( "vector<int> -> toString", "[toString][vector]" ) | ||||
| @@ -76,3 +76,11 @@ TEST_CASE( "vector<bool> -> toString", "[toString][containers][vector]" ) { | ||||
|     bools.push_back(false); | ||||
|     REQUIRE( ::Catch::Detail::stringify(bools) == "{ true, false }"); | ||||
| } | ||||
| TEST_CASE( "array<int, N> -> toString", "[toString][containers][array]" ) { | ||||
|     std::array<int, 0> empty; | ||||
|     REQUIRE( Catch::Detail::stringify( empty ) == "{  }" ); | ||||
|     std::array<int, 1> oneValue = {{ 42 }}; | ||||
|     REQUIRE( Catch::Detail::stringify( oneValue ) == "{ 42 }" ); | ||||
|     std::array<int, 2> twoValues = {{ 42, 250 }}; | ||||
|     REQUIRE( Catch::Detail::stringify( twoValues ) == "{ 42, 250 }" ); | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash