void test_to_number(char const* str, int_T wanted, bool error,
                    int_T (*fn)(char const*))
{
    bool threw = false;
    bool worked = false;
    int_T result = 0;
    std::string msg;
    try
    {
        result = fn(str);
        worked = (wanted == result);
    }
    catch (std::runtime_error const& e)
    {
        threw = true;
        msg = e.what();
    }
    if (threw)
    {
        if (error)
        {
            std::cout << str << " to int threw (" << msg << "): PASSED" << std::endl;
        }
        else
        {
            std::cout << str << " to int threw but wanted "
                      << wanted << std::endl;
        }
    }
    else
    {
        if (worked)
        {
            std::cout << str << " to int: PASSED" << std::endl;
        }
        else
        {
            std::cout << str << " to int failed; got " << result << std::endl;
        }
    }
}
void test_to_number(char const* str, int_T wanted, bool error,
                    int_T (*fn)(char const*))
{
    bool threw = false;
    bool worked = false;
    int_T result = 0;
    std::string msg;
    try
    {
        result = fn(str);
        worked = (wanted == result);
    }
    catch (std::runtime_error const& e)
    {
        threw = true;
        msg = e.what();
    }
    if (threw)
    {
        if (error)
        {
            std::cout << str << " to int threw (" << msg << "): PASSED" << std::endl;
        }
        else
        {
            std::cout << str << " to int threw but wanted "
                      << wanted << std::endl;
        }
    }
    else
    {
        if (worked)
        {
            std::cout << str << " to int: PASSED" << std::endl;
        }
        else
        {
            std::cout << str << " to int failed; got " << result << std::endl;
        }
    }
}