mirror of
https://github.com/nlohmann/json.git
synced 2024-11-24 06:29:03 +08:00
✅ add test
This commit is contained in:
parent
42d7193db2
commit
8794ba17c2
@ -19,60 +19,64 @@ struct ParserImpl final: public nlohmann::json_sax<json>
|
|||||||
bool null() override
|
bool null() override
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
bool boolean(bool /*val*/) override
|
bool boolean(bool /*val*/) override
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
bool number_integer(json::number_integer_t /*val*/) override
|
bool number_integer(json::number_integer_t /*val*/) override
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
bool number_unsigned(json::number_unsigned_t /*val*/) override
|
bool number_unsigned(json::number_unsigned_t /*val*/) override
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
bool number_float(json::number_float_t /*val*/, const json::string_t& s) override
|
bool number_float(json::number_float_t /*val*/, const json::string_t& s) override
|
||||||
{
|
{
|
||||||
float_string_copy = s;
|
float_string_copy = s;
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
bool string(json::string_t& /*val*/) override
|
bool string(json::string_t& /*val*/) override
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
bool binary(json::binary_t& /*val*/) override
|
bool binary(json::binary_t& /*val*/) override
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
bool start_object(std::size_t /*val*/) override
|
bool start_object(std::size_t /*val*/) override
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
bool key(json::string_t& /*val*/) override
|
bool key(json::string_t& /*val*/) override
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
bool end_object() override
|
bool end_object() override
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
bool start_array(std::size_t /*val*/) override
|
bool start_array(std::size_t /*val*/) override
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
bool end_array() override
|
bool end_array() override
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
bool parse_error(std::size_t /*val*/, const std::string& /*val*/, const nlohmann::detail::exception& /*val*/) override
|
bool parse_error(std::size_t /*val*/, const std::string& /*val*/, const nlohmann::detail::exception& /*val*/) override
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
~ParserImpl() override;
|
||||||
|
|
||||||
json::string_t float_string_copy;
|
json::string_t float_string_copy;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ParserImpl::~ParserImpl() = default;
|
||||||
|
|
||||||
TEST_CASE("locale-dependent test (LC_NUMERIC=C")
|
TEST_CASE("locale-dependent test (LC_NUMERIC=C")
|
||||||
{
|
{
|
||||||
if (std::setlocale(LC_NUMERIC, "C") == nullptr)
|
if (std::setlocale(LC_NUMERIC, "C") == nullptr)
|
||||||
|
Loading…
Reference in New Issue
Block a user