From dd080c54cd5b792d04302fcf16c9f063c1c9d8c8 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 12 Feb 2026 16:13:06 +0100 Subject: [PATCH] Test: Fix argument type of `std::put_money` The argument must be either a `long double` or a string according to the standard. Fixes #270 --- test/test_std_formatting.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_std_formatting.cpp b/test/test_std_formatting.cpp index 1a8386a3..a4446698 100644 --- a/test/test_std_formatting.cpp +++ b/test/test_std_formatting.cpp @@ -66,7 +66,7 @@ void test_by_char(const std::locale& l, const std::locale& lreal) const bool bad_parsing = [&]() { ss_ref_type ss_ref; ss_ref.imbue(lreal); - ss_ref << std::showbase << std::put_money(104334, false); + ss_ref << std::showbase << std::put_money(104334.L, false); std::ios_base::iostate err = std::ios_base::iostate(); typename std::money_get::iter_type end; long double tmp; @@ -95,7 +95,7 @@ void test_by_char(const std::locale& l, const std::locale& lreal) TEST_EQ(v1, 1043.34); } - empty_stream(ss_ref) << std::put_money(104334, false); + empty_stream(ss_ref) << std::put_money(104334.L, false); TEST_EQ(to_utf8(ss.str()), to_utf8(ss_ref.str())); } { @@ -111,7 +111,7 @@ void test_by_char(const std::locale& l, const std::locale& lreal) TEST_EQ(v1, 1043.34); } - empty_stream(ss_ref) << std::put_money(104334, true); + empty_stream(ss_ref) << std::put_money(104334.L, true); TEST_EQ(to_utf8(ss.str()), to_utf8(ss_ref.str())); } }