ToStringByte.tests.cpp 506 B

123456789101112131415
  1. #include "catch.hpp"
  2. #if defined(CATCH_CONFIG_CPP17_BYTE)
  3. TEST_CASE( "std::byte -> toString", "[toString][byte][approvals]" ) {
  4. using type = std::byte;
  5. REQUIRE( "0" == ::Catch::Detail::stringify( type{ 0 } ) );
  6. }
  7. TEST_CASE( "std::vector<std::byte> -> toString", "[toString][byte][approvals]" ) {
  8. using type = std::vector<std::byte>;
  9. REQUIRE( "{ 0, 1, 2 }" == ::Catch::Detail::stringify( type{ std::byte{0}, std::byte{1}, std::byte{2} } ) );
  10. }
  11. #endif // CATCH_INTERNAL_CONFIG_CPP17_BYTE