Skip to content

Commit 0a8b48a

Browse files
authored
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>
1 parent dff2b47 commit 0a8b48a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/src/unit-locale-cpp.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,12 @@ TEST_CASE("locale-dependent test (LC_NUMERIC=de_DE)")
139139
{
140140
std::array<char, 6> buffer = {};
141141
CHECK(std::snprintf(buffer.data(), buffer.size(), "%.2f", 12.34) == 5); // NOLINT(cppcoreguidelines-pro-type-vararg,hicpp-vararg)
142-
CHECK(std::string(buffer.data()) == "12,34");
142+
const auto snprintf_result = std::string(buffer.data());
143+
if (snprintf_result != "12,34")
144+
{
145+
CAPTURE(snprintf_result)
146+
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).");
147+
}
143148
}
144149

145150
SECTION("parsing")

0 commit comments

Comments
 (0)