On Windows, the en_US.UTF-8 locale returns n_sign_posn == 0, which
means that the sign for a negative currency is parentheses around
the whole value, instead of a leading minus.
Details
Details
- Reviewers
Mordante • Quuxplusone - Group Reviewers
Restricted Project - Commits
- rG2d54bf3bc751: [libcxx] [test] Fix the monetary locale negative_sign test for en_US.UTF-8 on…
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Unit Tests
Event Timeline
Comment Actions
Simplify the patch significantly, fixing building in configurations without wchar available.
Comment Actions
Seems fine to me. My only suggestion is that I imagine there must be other tests that need updating in the same way for actually formatting negative numbers, like
Fwt f(LOCALE_en_US_UTF_8, 1); #if defined(_WIN32) assert(f.whateverformatmoney(-42) == L"(42)"); #else assert(f.whateverformatmoney(-42) == L"-42"); #endif
and maybe you could hit those tests in this same PR?
Comment Actions
Yes, there’s actually a bunch of them. Unfortunately, some of them require a whole lot of churn in the tests, so I’m a bit undecided about some of them, whether it’s worth to fix them, or just change the XFAIL to a non-FIXME version, with an explanation. But this one seemed tolerable enough at least.