From 7b20684273529de83d9adb72e01385ec124b4898 Mon Sep 17 00:00:00 2001 From: Sean Middleditch Date: Sun, 14 Jan 2024 19:44:54 -0800 Subject: [PATCH] Replace Catch2 with doctest (#56) --- .clang-format | 15 ++++----- cmake/fetch_catch2.cmake | 12 ------- cmake/fetch_doctest.cmake | 10 ++++++ tests/CMakeLists.txt | 4 +-- tests/test_charconv.cpp | 48 +++++++++++++------------- tests/test_format.cpp | 69 ++++++++++++++++++++------------------ tests/test_format_args.cpp | 29 ++++++++-------- 7 files changed, 94 insertions(+), 93 deletions(-) delete mode 100644 cmake/fetch_catch2.cmake create mode 100644 cmake/fetch_doctest.cmake diff --git a/.clang-format b/.clang-format index 2dd1d1f..e4580af 100644 --- a/.clang-format +++ b/.clang-format @@ -64,24 +64,21 @@ IncludeCategories: - Regex: '^"[^/]+"' Priority: 0 SortPriority: 10 - - Regex: '^["<]potato/spud/' + - Regex: '^["<]nanofmt/' Priority: 50 SortPriority: 70 - - Regex: '^["<]potato/runtime/' - Priority: 50 - SortPriority: 60 - - Regex: '^["<]potato/' - Priority: 50 - SortPriority: 30 - Regex: '^".*"' Priority: 0 SortPriority: 20 - Regex: '/' - Priority: 100 + Priority: 90 SortPriority: 80 + - Regex: '[.]' + Priority: 90 + SortPriority: 90 - Regex: '.*' Priority: 100 - SortPriority: 90 + SortPriority: 100 IncludeIsMainRegex: '([.][a-z]+)?$' IndentCaseBlocks: true IndentCaseLabels: true diff --git a/cmake/fetch_catch2.cmake b/cmake/fetch_catch2.cmake deleted file mode 100644 index 2780191..0000000 --- a/cmake/fetch_catch2.cmake +++ /dev/null @@ -1,12 +0,0 @@ -include(FetchContent) - -FetchContent_Declare( - Catch2 - SYSTEM - GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG v3.5.1 -) - -FetchContent_MakeAvailable(Catch2) - -list(APPEND CMAKE_MODULE_PATH ${Catch2_SOURCE_DIR}/extras) diff --git a/cmake/fetch_doctest.cmake b/cmake/fetch_doctest.cmake new file mode 100644 index 0000000..31cae6d --- /dev/null +++ b/cmake/fetch_doctest.cmake @@ -0,0 +1,10 @@ +include(FetchContent) + +FetchContent_Declare( + doctest + SYSTEM + GIT_REPOSITORY https://github.com/doctest/doctest.git + GIT_TAG v2.4.11 +) + +FetchContent_MakeAvailable(doctest) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 85d4942..298ebe1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -include(fetch_catch2) +include(fetch_doctest) add_executable(nanofmt_test) target_sources(nanofmt_test PRIVATE @@ -10,7 +10,7 @@ target_sources(nanofmt_test PRIVATE ) target_link_libraries(nanofmt_test PRIVATE nanofmt - Catch2::Catch2WithMain + doctest::doctest_with_main ) add_test(NAME nanofmt_test COMMAND nanofmt_test) diff --git a/tests/test_charconv.cpp b/tests/test_charconv.cpp index a1e1a40..fa3fee7 100644 --- a/tests/test_charconv.cpp +++ b/tests/test_charconv.cpp @@ -1,17 +1,19 @@ // Copyright (c) Sean Middleditch and contributors. See accompanying LICENSE.md for copyright details. #include "test_utils.h" + #include "nanofmt/charconv.h" -#include +#include + #include #include -TEST_CASE("nanofmt.to_chars.integers", "[nanofmt][to_chars][integers]") { +TEST_CASE("nanofmt.to_chars.integers") { using namespace NANOFMT_NS::test; using namespace NANOFMT_NS; - SECTION("decimal") { + SUBCASE("decimal") { CHECK(to_string(0) == "0"); CHECK(to_string(1) == "1"); CHECK(to_string(10) == "10"); @@ -19,7 +21,7 @@ TEST_CASE("nanofmt.to_chars.integers", "[nanofmt][to_chars][integers]") { CHECK(to_string(1'000) == "1000"); } - SECTION("hex") { + SUBCASE("hex") { CHECK(to_string(0x0, int_format::hex) == "0"); CHECK(to_string(0x1, int_format::hex) == "1"); @@ -27,7 +29,7 @@ TEST_CASE("nanofmt.to_chars.integers", "[nanofmt][to_chars][integers]") { CHECK(to_string(0xdeadc0de, int_format::hex_upper) == "DEADC0DE"); } - SECTION("binary") { + SUBCASE("binary") { CHECK(to_string(0b0, int_format::binary) == "0"); CHECK(to_string(0b1, int_format::binary) == "1"); @@ -36,7 +38,7 @@ TEST_CASE("nanofmt.to_chars.integers", "[nanofmt][to_chars][integers]") { CHECK(to_string(-0b01011010, int_format::binary) == "-1011010"); } - SECTION("negatives") { + SUBCASE("negatives") { CHECK(to_string(-0) == "0"); CHECK(to_string(-1) == "-1"); CHECK(to_string(-10) == "-10"); @@ -44,7 +46,7 @@ TEST_CASE("nanofmt.to_chars.integers", "[nanofmt][to_chars][integers]") { CHECK(to_string(-1'000) == "-1000"); } - SECTION("bounds") { + SUBCASE("bounds") { CHECK(to_string(std::numeric_limits::max()) == "127"); CHECK(to_string(std::numeric_limits::max()) == "32767"); CHECK(to_string(std::numeric_limits::max()) == "2147483647"); @@ -62,11 +64,11 @@ TEST_CASE("nanofmt.to_chars.integers", "[nanofmt][to_chars][integers]") { } } -TEST_CASE("nanofmt.to_chars.fixed", "[nanofmt][to_chars][float][fixed]") { +TEST_CASE("nanofmt.to_chars.fixed") { using namespace NANOFMT_NS::test; using namespace NANOFMT_NS; - SECTION("whole numbers") { + SUBCASE("whole numbers") { CHECK(to_string(0e0f, float_format::fixed) == "0"); CHECK(to_string(1e0f, float_format::fixed) == "1"); CHECK(to_string(1e1f, float_format::fixed) == "10"); @@ -75,14 +77,14 @@ TEST_CASE("nanofmt.to_chars.fixed", "[nanofmt][to_chars][float][fixed]") { CHECK(to_string(1e4f, float_format::fixed) == "10000"); } - SECTION("fractional numbers") { + SUBCASE("fractional numbers") { CHECK(to_string(1e-1f, float_format::fixed) == "0.1"); CHECK(to_string(1e-2f, float_format::fixed) == "0.01"); CHECK(to_string(1e-3f, float_format::fixed) == "0.001"); CHECK(to_string(1e-4f, float_format::fixed) == "0.0001"); } - SECTION("bounds") { + SUBCASE("bounds") { CHECK( to_string(std::numeric_limits::max(), float_format::fixed) == "340282350000000000000000000000000000000"); @@ -106,7 +108,7 @@ TEST_CASE("nanofmt.to_chars.fixed", "[nanofmt][to_chars][float][fixed]") { "00022250738585072014"); } - SECTION("rounding") { + SUBCASE("rounding") { CHECK(to_string(.001, float_format::fixed, 0) == "0"); CHECK(to_string(1.55, float_format::fixed, 0) == "2"); CHECK(to_string(1.55, float_format::fixed, 1) == "1.6"); @@ -116,7 +118,7 @@ TEST_CASE("nanofmt.to_chars.fixed", "[nanofmt][to_chars][float][fixed]") { CHECK(to_string(1.251, float_format::fixed, 1) == "1.3"); } - SECTION("nonfinite") { + SUBCASE("nonfinite") { CHECK(to_string(std::numeric_limits::infinity(), float_format::fixed) == "inf"); CHECK(to_string(-std::numeric_limits::infinity(), float_format::fixed) == "-inf"); CHECK(to_string(std::numeric_limits::quiet_NaN(), float_format::fixed) == "nan"); @@ -124,11 +126,11 @@ TEST_CASE("nanofmt.to_chars.fixed", "[nanofmt][to_chars][float][fixed]") { } } -TEST_CASE("nanofmt.to_chars.scientifix", "[nanofmt][to_chars][float][scientific]") { +TEST_CASE("nanofmt.to_chars.scientifix") { using namespace NANOFMT_NS::test; using namespace NANOFMT_NS; - SECTION("whole numbers") { + SUBCASE("whole numbers") { CHECK(to_string(0e0f, float_format::scientific) == "0e+00"); CHECK(to_string(1e0f, float_format::scientific) == "1e+00"); CHECK(to_string(1e1f, float_format::scientific) == "1e+01"); @@ -137,21 +139,21 @@ TEST_CASE("nanofmt.to_chars.scientifix", "[nanofmt][to_chars][float][scientific] CHECK(to_string(1e4f, float_format::scientific) == "1e+04"); } - SECTION("fractional numbers") { + SUBCASE("fractional numbers") { CHECK(to_string(1e-1f, float_format::scientific) == "1e-01"); CHECK(to_string(1e-2f, float_format::scientific) == "1e-02"); CHECK(to_string(1e-3f, float_format::scientific) == "1e-03"); CHECK(to_string(1e-4f, float_format::scientific) == "1e-04"); } - SECTION("mixed numbers") { + SUBCASE("mixed numbers") { CHECK(to_string(1.55e-1f, float_format::scientific) == "1.55e-01"); CHECK(to_string(12.55e-2f, float_format::scientific) == "1.255e-01"); CHECK(to_string(12'000.55'001f, float_format::scientific) == "1.200055e+04"); CHECK(to_string(1.55e-4f, float_format::scientific) == "1.55e-04"); } - SECTION("bounds") { + SUBCASE("bounds") { CHECK(to_string(std::numeric_limits::max(), float_format::scientific) == "3.4028235e+38"); CHECK(to_string(std::numeric_limits::max(), float_format::scientific) == "1.7976931348623157e+308"); @@ -159,7 +161,7 @@ TEST_CASE("nanofmt.to_chars.scientifix", "[nanofmt][to_chars][float][scientific] CHECK(to_string(std::numeric_limits::min(), float_format::scientific) == "2.2250738585072014e-308"); } - SECTION("rounding") { + SUBCASE("rounding") { CHECK(to_string(1.55e-4f, float_format::scientific, 0) == "2e-04"); CHECK(to_string(1.35e-4f, float_format::scientific, 1) == "1.4e-04"); CHECK(to_string(1.25e-4f, float_format::scientific, 1) == "1.2e-04"); @@ -167,7 +169,7 @@ TEST_CASE("nanofmt.to_chars.scientifix", "[nanofmt][to_chars][float][scientific] CHECK(to_string(1.251e-4f, float_format::scientific, 1) == "1.3e-04"); } - SECTION("nonfinite") { + SUBCASE("nonfinite") { CHECK(to_string(std::numeric_limits::infinity(), float_format::scientific) == "inf"); CHECK(to_string(-std::numeric_limits::infinity(), float_format::scientific) == "-inf"); CHECK(to_string(std::numeric_limits::quiet_NaN(), float_format::scientific) == "nan"); @@ -175,11 +177,11 @@ TEST_CASE("nanofmt.to_chars.scientifix", "[nanofmt][to_chars][float][scientific] } } -TEST_CASE("nanofmt.to_chars.general", "[nanofmt][to_chars][float][general]") { +TEST_CASE("nanofmt.to_chars.general") { using namespace NANOFMT_NS::test; using namespace NANOFMT_NS; - SECTION("bounds") { + SUBCASE("bounds") { CHECK(to_string(std::numeric_limits::max(), float_format::general) == "3.40282e+38"); CHECK(to_string(std::numeric_limits::max(), float_format::general) == "1.79769e+308"); @@ -187,7 +189,7 @@ TEST_CASE("nanofmt.to_chars.general", "[nanofmt][to_chars][float][general]") { CHECK(to_string(std::numeric_limits::min(), float_format::general) == "2.22507e-308"); } - SECTION("nonfinite") { + SUBCASE("nonfinite") { CHECK(to_string(std::numeric_limits::infinity(), float_format::general) == "inf"); CHECK(to_string(-std::numeric_limits::infinity(), float_format::general) == "-inf"); CHECK(to_string(std::numeric_limits::quiet_NaN(), float_format::general) == "nan"); diff --git a/tests/test_format.cpp b/tests/test_format.cpp index 86f2930..e4d97ab 100644 --- a/tests/test_format.cpp +++ b/tests/test_format.cpp @@ -2,10 +2,13 @@ #include "fwd_only_type.h" #include "test_utils.h" + #include "nanofmt/format.h" #include "nanofmt/std_string.h" -#include +#include + +#include #include enum class standard_enum { one, two }; @@ -47,10 +50,10 @@ namespace NANOFMT_NS { static_assert(NANOFMT_NS::detail::has_formatter::value, "has_formatter failed"); static_assert(NANOFMT_NS::detail::has_formatter::value, "has_formatter failed"); -TEST_CASE("nanofmt.format.core", "[nanofmt][format]") { +TEST_CASE("nanofmt.format.core") { using namespace NANOFMT_NS; - SECTION("format_to overflow") { + SUBCASE("format_to overflow") { char buffer[12]; std::memset(buffer, 0xfe, sizeof buffer); @@ -60,7 +63,7 @@ TEST_CASE("nanofmt.format.core", "[nanofmt][format]") { CHECK(std::strcmp(buffer, "Hello, Worl") == 0); } - SECTION("format_to_n overflow") { + SUBCASE("format_to_n overflow") { char buffer[12]; char* const end = format_to_n(buffer, sizeof buffer, "Hello, {}! {:09d}", "World", 9001); @@ -69,7 +72,7 @@ TEST_CASE("nanofmt.format.core", "[nanofmt][format]") { } } -TEST_CASE("nanofmt.format.append", "[nanofmt][format][append]") { +TEST_CASE("nanofmt.format.append") { using namespace NANOFMT_NS; char buffer[12] = {}; @@ -81,36 +84,36 @@ TEST_CASE("nanofmt.format.append", "[nanofmt][format][append]") { CHECK(std::strcmp(buffer, "Hello, Worl") == 0); } -TEST_CASE("nanofmt.format.integers", "[nanofmt][format][integers]") { +TEST_CASE("nanofmt.format.integers") { using namespace NANOFMT_NS::test; - SECTION("width and fill") { + SUBCASE("width and fill") { CHECK(sformat("{:6d}", 1234) == " 1234"); CHECK(sformat("{:6d}", -1234) == " -1234"); } - SECTION("zero pad") { + SUBCASE("zero pad") { CHECK(sformat("{:06}", 1234) == "001234"); CHECK(sformat("{:06}", -1234) == "-01234"); } - SECTION("precision") { + SUBCASE("precision") { // BUG? -- fmtlib/std::format doesn't support precision for integral types, should we nuke this? CHECK(sformat("{:.4}", 123456) == "1234"); CHECK(sformat("{:.4b}", 0b1001'0110) == "1001"); } - SECTION("char") { + SUBCASE("char") { CHECK(sformat("{:d}", ' ') == "32"); } - SECTION("hex") { + SUBCASE("hex") { CHECK(sformat("{:x}", ~16u) == "ffffffef"); CHECK(sformat("{:08x}", 0xDEAD) == "0000dead"); CHECK(sformat("{:08X}", 0xDEAD) == "0000DEAD"); } - SECTION("binary") { + SUBCASE("binary") { CHECK(sformat("{:b}", 0) == "0"); CHECK(sformat("{:b}", 0b11011) == "11011"); CHECK(sformat("{:b}", 5) == "101"); @@ -118,16 +121,16 @@ TEST_CASE("nanofmt.format.integers", "[nanofmt][format][integers]") { } } -TEST_CASE("nanofmt.format.floating", "[nanofmt][format][floating]") { +TEST_CASE("nanofmt.format.floating") { using namespace NANOFMT_NS::test; - SECTION("precision") { + SUBCASE("precision") { CHECK(sformat("{:.1f}", 1.55) == "1.6"); CHECK(sformat("{:.1e}", 1.45) == "1.4e+00"); CHECK(sformat("{}", std::numeric_limits::max()) == "3.40282e+38"); } - SECTION("signs") { + SUBCASE("signs") { CHECK(sformat("{:+.3}", 1.0) == "+1"); CHECK(sformat("{:+.3}", -1.0) == "-1"); CHECK(sformat("{:-.3}", 1.0) == "1"); @@ -136,7 +139,7 @@ TEST_CASE("nanofmt.format.floating", "[nanofmt][format][floating]") { CHECK(sformat("{: .3}", -1.0) == "-1"); } - SECTION("nonfinite") { + SUBCASE("nonfinite") { CHECK(sformat("{:f}", std::numeric_limits::infinity()) == "inf"); CHECK(sformat("{:f}", -std::numeric_limits::infinity()) == "-inf"); @@ -144,7 +147,7 @@ TEST_CASE("nanofmt.format.floating", "[nanofmt][format][floating]") { CHECK(sformat("{:f}", -std::numeric_limits::quiet_NaN()) == "-nan"); } - SECTION("casing") { + SUBCASE("casing") { CHECK(sformat("{:.2E}", -12.99) == "-1.30E+01"); CHECK(sformat("{:E}", -std::numeric_limits::infinity()) == "-INF"); @@ -153,17 +156,17 @@ TEST_CASE("nanofmt.format.floating", "[nanofmt][format][floating]") { } } -TEST_CASE("nanofmt.format.strings", "[nanofmt][format][strings]") { +TEST_CASE("nanofmt.format.strings") { using namespace NANOFMT_NS::test; - SECTION("char arrays") { + SUBCASE("char arrays") { char const s[] = "array"; CHECK(sformat("{}", "test") == "test"); CHECK(sformat("{}", s) == "array"); } - SECTION("stdlib") { + SUBCASE("stdlib") { CHECK(sformat("{}", std::string("test")) == "test"); CHECK(sformat("{}", std::string_view("test")) == "test"); @@ -172,33 +175,33 @@ TEST_CASE("nanofmt.format.strings", "[nanofmt][format][strings]") { CHECK(sformat(nanofmt::format_string(std::string("a{}c")), "b") == "abc"); } - SECTION("width and fill") { + SUBCASE("width and fill") { CHECK(sformat("{:<8}{:05}", "value", 42) == "value 00042"); } } -TEST_CASE("nanofmt.format.bools", "[nanofmt][format][bools]") { +TEST_CASE("nanofmt.format.bools") { using namespace NANOFMT_NS::test; - SECTION("default") { + SUBCASE("default") { CHECK(sformat("{}", true) == "true"); CHECK(sformat("{}", false) == "false"); } - SECTION("integer") { + SUBCASE("integer") { CHECK(sformat("{:d}", true) == "1"); CHECK(sformat("{:d}", false) == "0"); } } -TEST_CASE("nanofmt.format.pointers", "[nanofmt][format][pointers]") { +TEST_CASE("nanofmt.format.pointers") { using namespace NANOFMT_NS::test; - SECTION("nullptr") { + SUBCASE("nullptr") { CHECK(sformat("{}", nullptr) == "0x0"); } - SECTION("raw") { + SUBCASE("raw") { void const* ptr = reinterpret_cast(static_cast(0xDEADC0DE)); int const* iptr = reinterpret_cast(static_cast(0xFEFEFEFE)); @@ -207,19 +210,19 @@ TEST_CASE("nanofmt.format.pointers", "[nanofmt][format][pointers]") { } } -TEST_CASE("nanofmt.format.enums", "[nanofmt][format][enums]") { +TEST_CASE("nanofmt.format.enums") { using namespace NANOFMT_NS::test; - SECTION("standard") { + SUBCASE("standard") { CHECK(sformat("{0}", standard_enum::two) == "1"); } - SECTION("custom") { + SUBCASE("custom") { CHECK(sformat("{}", custom_enum::bar) == "bar"); } } -TEST_CASE("nanofmt.format.custom", "[nanofmt][format][custom]") { +TEST_CASE("nanofmt.format.custom") { using namespace NANOFMT_NS::test; custom_type local{7}; @@ -237,7 +240,7 @@ TEST_CASE("nanofmt.format.custom", "[nanofmt][format][custom]") { CHECK(sformat("{}", fwd_only_type{}) == "fwd_only_type"); } -TEST_CASE("nanofmt.format.length", "[nanofmt][format][length]") { +TEST_CASE("nanofmt.format.length") { using namespace NANOFMT_NS; CHECK(format_length("{}") == 0); @@ -247,7 +250,7 @@ TEST_CASE("nanofmt.format.length", "[nanofmt][format][length]") { CHECK(format_length("{0} = 0x{0:X} = 0b{0:b}", 28) == 19); } -// TEST_CASE("nanofmt.format.compile_error", "[nanofmt][format][error]") { +// TEST_CASE("nanofmt.format.compile_error") { // using namespace NANOFMT_NS::test; // // CHECK(sformat("{}", unknown{}) == ""); diff --git a/tests/test_format_args.cpp b/tests/test_format_args.cpp index d6f3706..9ac2528 100644 --- a/tests/test_format_args.cpp +++ b/tests/test_format_args.cpp @@ -1,9 +1,10 @@ // Copyright (c) Sean Middleditch and contributors. See accompanying LICENSE.md for copyright details. #include "test_utils.h" + #include "nanofmt/format.h" -#include +#include namespace { template @@ -12,22 +13,22 @@ namespace { } } // namespace -TEST_CASE("nanofmt.format_arg.misc", "[nanofmt][format_arg]") { +TEST_CASE("nanofmt.format_arg.misc") { using namespace NANOFMT_NS; CHECK(to_arg(true).tag == format_arg::type::t_bool); CHECK(to_arg('c').tag == format_arg::type::t_char); } -TEST_CASE("nanofmt.format_arg.integers", "[nanofmt][format_arg][integers]") { +TEST_CASE("nanofmt.format_arg.integers") { using namespace NANOFMT_NS; - SECTION("misc") { + SUBCASE("misc") { CHECK(to_arg(true).tag == format_arg::type::t_bool); CHECK(to_arg('c').tag == format_arg::type::t_char); } - SECTION("signed") { + SUBCASE("signed") { using signed_char = signed char; CHECK(to_arg(signed_char{}).tag == format_arg::type::t_int); @@ -37,7 +38,7 @@ TEST_CASE("nanofmt.format_arg.integers", "[nanofmt][format_arg][integers]") { CHECK(to_arg(0ll).tag == format_arg::type::t_longlong); } - SECTION("unsigned") { + SUBCASE("unsigned") { using unsigned_char = unsigned char; using unsigned_short = unsigned short; @@ -49,17 +50,17 @@ TEST_CASE("nanofmt.format_arg.integers", "[nanofmt][format_arg][integers]") { } } -TEST_CASE("nanofmt.format_arg.floats", "[nanofmt][format_arg][floats]") { +TEST_CASE("nanofmt.format_arg.floats") { using namespace NANOFMT_NS; CHECK(to_arg(0.f).tag == format_arg::type::t_float); CHECK(to_arg(0.0).tag == format_arg::type::t_double); } -TEST_CASE("nanofmt.format_arg.pointers", "[nanofmt][format_arg][pointers][strings]") { +TEST_CASE("nanofmt.format_arg.pointers") { using namespace NANOFMT_NS; - SECTION("pointers") { + SUBCASE("pointers") { void const* cptr = nullptr; void* ptr = nullptr; @@ -68,7 +69,7 @@ TEST_CASE("nanofmt.format_arg.pointers", "[nanofmt][format_arg][pointers][string CHECK(to_arg(nullptr).tag == format_arg::type::t_voidptr); } - SECTION("C strings") { + SUBCASE("C strings") { char chars[16] = {}; char const* cstr = nullptr; char* str = nullptr; @@ -88,7 +89,7 @@ namespace { enum class chonky_enum_class : long long { value }; } // namespace -TEST_CASE("nanofmt.format_arg.enums", "[nanofmt][format_arg][pointers][enums]") { +TEST_CASE("nanofmt.format_arg.enums") { using namespace NANOFMT_NS; CHECK(to_arg(cenum_value).tag == format_arg::type::t_int); @@ -119,14 +120,14 @@ namespace NANOFMT_NS { struct formatter : custom_formatter_base {}; } // namespace NANOFMT_NS -TEST_CASE("nanofmt.format_arg.custom", "[nanofmt][format_arg][pointers][custom]") { +TEST_CASE("nanofmt.format_arg.custom") { using namespace NANOFMT_NS; - SECTION("enums") { + SUBCASE("enums") { CHECK(to_arg(custom::enum_class::value).tag == format_arg::type::t_custom); } - SECTION("objects") { + SUBCASE("objects") { custom::struct_type st; const custom::struct_type cst; custom::class_type ct;