diff options
| author | Phil Nash | 2018-01-04 10:52:55 +0000 |
|---|---|---|
| committer | Phil Nash | 2018-01-04 10:52:55 +0000 |
| commit | 8be1df243e18e4a511b413f49f69546bb4607d2c (patch) | |
| tree | 019a3bd339096c5fc345d0b7113af34c87800d12 /projects/SelfTest/UsageTests/ToStringVector.tests.cpp | |
| parent | 32eb90b9bdaf45bb1d76ca8bc4efaa3aeaf9a134 (diff) | |
| download | catch3-8be1df243e18e4a511b413f49f69546bb4607d2c.tar.gz | |
Added test for stringifying std::arrays
Diffstat (limited to 'projects/SelfTest/UsageTests/ToStringVector.tests.cpp')
| -rw-r--r-- | projects/SelfTest/UsageTests/ToStringVector.tests.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/projects/SelfTest/UsageTests/ToStringVector.tests.cpp b/projects/SelfTest/UsageTests/ToStringVector.tests.cpp index 0b993c4e..18e56c08 100644 --- a/projects/SelfTest/UsageTests/ToStringVector.tests.cpp +++ b/projects/SelfTest/UsageTests/ToStringVector.tests.cpp @@ -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 }" ); +}
\ No newline at end of file |