Adding a couple of tests.

This commit is contained in:
Daniel Lemire 2023-09-14 10:13:55 -04:00
parent 6a390f63e9
commit 2eb7b2ebda

View File

@ -34,7 +34,9 @@ bool eddelbuettel() {
"NaN",
"",
"-Inf",
"+2.2"};
"+2.2",
"1d+4",
"1d-1"};
std::vector<std::pair<bool, double>> expected_results = {
{true, std::numeric_limits<double>::infinity()},
{true, 3.16227766016838},
@ -60,7 +62,9 @@ bool eddelbuettel() {
{true, std::numeric_limits<double>::quiet_NaN()},
{false, -1},
{true, -std::numeric_limits<double>::infinity()},
{true, 2.2}};
{true, 2.2},
{false, -1},
{false, -1}};
for (size_t i = 0; i < inputs.size(); i++) {
std::string &input = inputs[i];
std::pair<bool, double> expected = expected_results[i];