ToStringByte.tests.cpp 771 B

1234567891011121314151617181920212223
  1. // Copyright Catch2 Authors
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // https://www.boost.org/LICENSE_1_0.txt)
  5. // SPDX-License-Identifier: BSL-1.0
  6. #include <catch2/catch_test_macros.hpp>
  7. #if defined(CATCH_CONFIG_CPP17_BYTE)
  8. TEST_CASE( "std::byte -> toString", "[toString][byte][approvals]" ) {
  9. using type = std::byte;
  10. REQUIRE( "0" == ::Catch::Detail::stringify( type{ 0 } ) );
  11. }
  12. TEST_CASE( "std::vector<std::byte> -> toString", "[toString][byte][approvals]" ) {
  13. using type = std::vector<std::byte>;
  14. REQUIRE( "{ 0, 1, 2 }" == ::Catch::Detail::stringify( type{ std::byte{0}, std::byte{1}, std::byte{2} } ) );
  15. }
  16. #endif // CATCH_INTERNAL_CONFIG_CPP17_BYTE