Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/projects/SelfTest/UsageTests/ToStringVector.tests.cpp
diff options
context:
space:
mode:
authorPhil Nash2018-01-04 10:52:55 +0000
committerPhil Nash2018-01-04 10:52:55 +0000
commit8be1df243e18e4a511b413f49f69546bb4607d2c (patch)
tree019a3bd339096c5fc345d0b7113af34c87800d12 /projects/SelfTest/UsageTests/ToStringVector.tests.cpp
parent32eb90b9bdaf45bb1d76ca8bc4efaa3aeaf9a134 (diff)
downloadcatch3-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.cpp10
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