mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-06 16:56:57 +08:00
lint
This commit is contained in:
parent
1ab438cf7a
commit
929e98182e
@ -23,7 +23,8 @@ namespace detail {
|
|||||||
template <typename T, typename UC>
|
template <typename T, typename UC>
|
||||||
from_chars_result_t<UC>
|
from_chars_result_t<UC>
|
||||||
FASTFLOAT_CONSTEXPR14 parse_infnan(UC const *first, UC const *last,
|
FASTFLOAT_CONSTEXPR14 parse_infnan(UC const *first, UC const *last,
|
||||||
T &value, const chars_format fmt) noexcept {
|
T &value,
|
||||||
|
const chars_format fmt) noexcept {
|
||||||
from_chars_result_t<UC> answer{};
|
from_chars_result_t<UC> answer{};
|
||||||
answer.ptr = first;
|
answer.ptr = first;
|
||||||
answer.ec = std::errc(); // be optimistic
|
answer.ec = std::errc(); // be optimistic
|
||||||
|
|||||||
@ -656,8 +656,7 @@ TEST_CASE("decimal_point_parsing") {
|
|||||||
|
|
||||||
answer = fast_float::from_chars_advanced(
|
answer = fast_float::from_chars_advanced(
|
||||||
input.data(), input.data() + input.size(), result,
|
input.data(), input.data() + input.size(), result,
|
||||||
fast_float::parse_options(fast_float::chars_format::general, ',', 10)
|
fast_float::parse_options(fast_float::chars_format::general, ',', 10));
|
||||||
);
|
|
||||||
CHECK_MESSAGE(answer.ec == std::errc(), "expected parse success");
|
CHECK_MESSAGE(answer.ec == std::errc(), "expected parse success");
|
||||||
CHECK_MESSAGE(answer.ptr == input.data() + input.size(),
|
CHECK_MESSAGE(answer.ptr == input.data() + input.size(),
|
||||||
"Parsing should have stopped at end");
|
"Parsing should have stopped at end");
|
||||||
@ -667,8 +666,7 @@ TEST_CASE("decimal_point_parsing") {
|
|||||||
std::string const input = "1.25";
|
std::string const input = "1.25";
|
||||||
auto answer = fast_float::from_chars_advanced(
|
auto answer = fast_float::from_chars_advanced(
|
||||||
input.data(), input.data() + input.size(), result,
|
input.data(), input.data() + input.size(), result,
|
||||||
fast_float::parse_options(fast_float::chars_format::general, ',', 10)
|
fast_float::parse_options(fast_float::chars_format::general, ',', 10));
|
||||||
);
|
|
||||||
CHECK_MESSAGE(answer.ec == std::errc(), "expected parse success");
|
CHECK_MESSAGE(answer.ec == std::errc(), "expected parse success");
|
||||||
CHECK_MESSAGE(answer.ptr == input.data() + 1,
|
CHECK_MESSAGE(answer.ptr == input.data() + 1,
|
||||||
"Parsing should have stopped at dot");
|
"Parsing should have stopped at dot");
|
||||||
@ -676,8 +674,7 @@ TEST_CASE("decimal_point_parsing") {
|
|||||||
|
|
||||||
answer = fast_float::from_chars_advanced(
|
answer = fast_float::from_chars_advanced(
|
||||||
input.data(), input.data() + input.size(), result,
|
input.data(), input.data() + input.size(), result,
|
||||||
fast_float::parse_options{}
|
fast_float::parse_options{});
|
||||||
);
|
|
||||||
CHECK_MESSAGE(answer.ec == std::errc(), "expected parse success");
|
CHECK_MESSAGE(answer.ec == std::errc(), "expected parse success");
|
||||||
CHECK_MESSAGE(answer.ptr == input.data() + input.size(),
|
CHECK_MESSAGE(answer.ptr == input.data() + input.size(),
|
||||||
"Parsing should have stopped at end");
|
"Parsing should have stopped at end");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user