Add comment regarding #4767 (#4770)

* 💡 add comment regarding #4767

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ✏️ address review comments

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

* ✏️ address review comments

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

---------

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann 2025-05-04 10:27:58 +02:00 committed by GitHub
parent dff2b4756c
commit 0a8b48ac6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -139,7 +139,12 @@ TEST_CASE("locale-dependent test (LC_NUMERIC=de_DE)")
{
std::array<char, 6> buffer = {};
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");
const auto snprintf_result = std::string(buffer.data());
if (snprintf_result != "12,34")
{
CAPTURE(snprintf_result)
MESSAGE("To test if number parsing is locale-independent, we set the locale to de_DE. However, on this system, the decimal separator doesn't change to `,` potentially due to a known musl issue (https://github.com/nlohmann/json/issues/4767).");
}
}
SECTION("parsing")