From 6ec3ace4976daea89e23a9f7dec2551a0edf6eeb Mon Sep 17 00:00:00 2001 From: Kent Ross Date: Tue, 14 Sep 2021 20:11:25 -0700 Subject: [PATCH] Fix long_test and add it to the non-exhaustive test suite --- tests/CMakeLists.txt | 1 + tests/long_test.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6cb22e4..9704aa2 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -56,6 +56,7 @@ endfunction(fast_float_add_cpp_test) fast_float_add_cpp_test(example_test) fast_float_add_cpp_test(example_comma_test) fast_float_add_cpp_test(basictest) +fast_float_add_cpp_test(long_test) fast_float_add_cpp_test(powersoffive_hardround) fast_float_add_cpp_test(string_test) diff --git a/tests/long_test.cpp b/tests/long_test.cpp index 1ab370a..4af8d50 100644 --- a/tests/long_test.cpp +++ b/tests/long_test.cpp @@ -1,5 +1,6 @@ #include "fast_float/fast_float.h" +#include #include inline void Assert(bool Assertion) { @@ -14,6 +15,7 @@ bool test() { const char * end = input.data() + input.size(); for(size_t i = 0; i < answers.size(); i++) { T result_value; + while((begin < end) && (std::isspace(*begin))) { begin++; } auto result = fast_float::from_chars(begin, end, result_value); if (result.ec != std::errc()) {