In the en_US locale on Windows, negative currency amounts is formatted
as "($0.01)" instead of "-$0.01".
Adjust the test references accordingly, making these tests pass.
This is more of the same as in D120549.
Paths
| Differential D120798
[libcxx] [test] Fix en_US money locale formatting tests on Windows ClosedPublic Authored by mstorsjo on Mar 2 2022, 1:23 AM.
Details
Summary In the en_US locale on Windows, negative currency amounts is formatted Adjust the test references accordingly, making these tests pass. This is more of the same as in D120549.
Diff Detail
Event TimelineComment Actions Looks reasonable to me. I do still wonder if it would be profitable to introduce a macro throughout instead of repeating the less-greppable #ifdef _WIN32; something like ASSERT_ON_WIN32(ex == L" (USD1,234,567.89)"); ASSERT_EXCEPT_WIN32(ex == L" -USD 1,234,567.89"); or even something like ASSERT_EQ_WIN32(ex, L" -USD 1,234,567.89", L" (USD1,234,567.89)"); (although that's a terrible name and I can't think of a good one). This revision is now accepted and ready to land.Mar 2 2022, 12:55 PM Closed by commit rG142501117a78: [libcxx] [test] Fix en_US money locale formatting tests on Windows (authored by mstorsjo). · Explain WhyMar 2 2022, 1:25 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 412528 libcxx/test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp
libcxx/test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_en_US.pass.cpp
libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_string_en_US.pass.cpp
|