mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-02-08 10:46:52 +08:00
Adding a couple of tests.
This commit is contained in:
parent
6a390f63e9
commit
2eb7b2ebda
@ -34,7 +34,9 @@ bool eddelbuettel() {
|
|||||||
"NaN",
|
"NaN",
|
||||||
"",
|
"",
|
||||||
"-Inf",
|
"-Inf",
|
||||||
"+2.2"};
|
"+2.2",
|
||||||
|
"1d+4",
|
||||||
|
"1d-1"};
|
||||||
std::vector<std::pair<bool, double>> expected_results = {
|
std::vector<std::pair<bool, double>> expected_results = {
|
||||||
{true, std::numeric_limits<double>::infinity()},
|
{true, std::numeric_limits<double>::infinity()},
|
||||||
{true, 3.16227766016838},
|
{true, 3.16227766016838},
|
||||||
@ -60,7 +62,9 @@ bool eddelbuettel() {
|
|||||||
{true, std::numeric_limits<double>::quiet_NaN()},
|
{true, std::numeric_limits<double>::quiet_NaN()},
|
||||||
{false, -1},
|
{false, -1},
|
||||||
{true, -std::numeric_limits<double>::infinity()},
|
{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++) {
|
for (size_t i = 0; i < inputs.size(); i++) {
|
||||||
std::string &input = inputs[i];
|
std::string &input = inputs[i];
|
||||||
std::pair<bool, double> expected = expected_results[i];
|
std::pair<bool, double> expected = expected_results[i];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user