/* * This source code is released into the public domain. */ // Include this first to ensure it's self-contained. #include "generic_error.hh" #include using namespace std::literals; using namespace lfjail; #define TEST_CASE(name) \ ATF_TEST_CASE_WITHOUT_HEAD(name) \ ATF_TEST_CASE_BODY(name) TEST_CASE(basic) { try { throw generic_error("{} + {} = {}", 1, 2, 3); } catch (generic_error const &exc) { ATF_REQUIRE_EQ("1 + 2 = 3"s, exc.what()); } } ATF_INIT_TEST_CASES(tcs) { ATF_ADD_TEST_CASE(tcs, basic); }