mirror of
https://github.com/nlohmann/json
synced 2024-11-23 20:40:08 +00:00
🐛 make SAX output locale-independent #4084
This commit is contained in:
parent
0b8da375b9
commit
77284a4763
@ -114,7 +114,7 @@ TEST_CASE("locale-dependent test (LC_NUMERIC=C)")
|
|||||||
SECTION("check if locale is properly set")
|
SECTION("check if locale is properly set")
|
||||||
{
|
{
|
||||||
std::array<char, 6> buffer = {};
|
std::array<char, 6> buffer = {};
|
||||||
CHECK(std::snprintf(buffer.data(), buffer.size(), "%.2f", 12.34) == 5); // NOLINT(cppcoreguidelines-pro-type-vararg)
|
CHECK(std::snprintf(buffer.data(), buffer.size(), "%.2f", 12.34) == 5); // NOLINT(cppcoreguidelines-pro-type-vararg,hicpp-vararg)
|
||||||
CHECK(std::string(buffer.data()) == "12.34");
|
CHECK(std::string(buffer.data()) == "12.34");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ TEST_CASE("locale-dependent test (LC_NUMERIC=de_DE)")
|
|||||||
SECTION("check if locale is properly set")
|
SECTION("check if locale is properly set")
|
||||||
{
|
{
|
||||||
std::array<char, 6> buffer = {};
|
std::array<char, 6> buffer = {};
|
||||||
CHECK(std::snprintf(buffer.data(), buffer.size(), "%.2f", 12.34) == 5); // NOLINT(cppcoreguidelines-pro-type-vararg)
|
CHECK(std::snprintf(buffer.data(), buffer.size(), "%.2f", 12.34) == 5); // NOLINT(cppcoreguidelines-pro-type-vararg,hicpp-vararg)
|
||||||
CHECK(std::string(buffer.data()) == "12,34");
|
CHECK(std::string(buffer.data()) == "12,34");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user