Debian Codegraph @

src/external/catch2/tests/SelfTest/UsageTests/ToStringByte.tests.cpp

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