mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 04:07:10 +01:00 
			
		
		
		
	Added special handling for vector<bool> when stringifying
This commit is contained in:
		| @@ -66,3 +66,13 @@ TEST_CASE( "vec<vec<string,alloc>> -> toString", "[toString][vector,allocator]" | ||||
|     v.push_back( inner { "world" } ); | ||||
|     REQUIRE( ::Catch::Detail::stringify(v) == "{ { \"hello\" }, { \"world\" } }" ); | ||||
| } | ||||
|  | ||||
| // Based on PR by mat-so: https://github.com/catchorg/Catch2/pull/606/files#diff-43562f40f8c6dcfe2c54557316e0f852 | ||||
| TEST_CASE( "vector<bool> -> toString", "[toString][containers][vector]" ) { | ||||
|     std::vector<bool> bools; | ||||
|     REQUIRE( ::Catch::Detail::stringify(bools) == "{  }"); | ||||
|     bools.push_back(true); | ||||
|     REQUIRE( ::Catch::Detail::stringify(bools) == "{ true }"); | ||||
|     bools.push_back(false); | ||||
|     REQUIRE( ::Catch::Detail::stringify(bools) == "{ true, false }"); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash