New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix failing locale tests on Apple platforms with the RU locale #45084
Comments
assigned to @ldionne |
Here's a reproducer for one of these failing tests. I suspect they are all the same failure under the hood: $ clang++ repro.cpp -g -std=c++2a -nostdinc++ -I libcxx/include -isysroot $(xcrun --show-sdk-path) -I libcxx/test/support -L build/lib -nostdlib++ -lc++ -Wl,-rpath,$PWD/build/lib -o a.out && ./a.out $ cat repro.cpp
|
I also ran into this while testing on FreeBSD. It appears that the problem is that the space after "RUB " is not consumed on Apple and FreeBSD. I can upload a patch for this shortly. Would you prefer a) #if defined(FreeBSD) || defined(APPLE) Or b) Changing e.g. "-1 234 567,89 RUB " to "-1 234 567,89 RUB". I'm not sure if the space is important, but removing it fixes the test for me. |
The fr_FR tests seem to use "1 234 567,89 EUR" without the trailing space, so I guess that means omitting it is fine? |
I think I would do b), so that the tests are as streamlined as possible. TBH, I don't understand why there's subtle differences like:
Why do we check for eofbit when parsing 0,00 RUB, but goodbit when parsing -0,01 RUB? I would try to remove the trailing space and see whether that still works. If you upload a patch on Phabricator, that'll also run the tests on Linux and macOS automatically, so you can experiment that way. Thanks for looking into it.. these locale APIs are terrible. :-) |
I ran into this issue, while poking those test files, and I went ahead and tried to fix it - see https://reviews.llvm.org/D120316. I also agree that we should remove the trailing space there; that matches other similar tests. This test seemed to be unusually untested in the sense that it was XFAILed in essentially all configurations in our current CI except for Apple platforms, and on Apple platforms, these bits were ifdeffed out. On top of that, I made https://reviews.llvm.org/D120317 which makes the test a bit more flexible, so that it passes on Glibc, FreeBSD and Windows too. |
…forms This fixes issue #45084 (https://llvm.org/PR45739). Remove unnecessary trailing spaces after the "RUB" international currency symbol (and after the plain number in some parts of the put_long_double test). Both of these test files are `XFAIL: netbsd || linux || LIBCXX-WINDOWS-FIXME`, and then have some of their test cases commented out when `__APPLE__`. This patch comments-in those test cases and adjusts them all to work on Apple, while leaving the test `XFAIL`ed on NetBSD, Linux, and Windows. Differential Revision: https://reviews.llvm.org/D120316
This issue should be fixed now by 5333732. |
Extended Description
The following tests are failing on Apple platforms:
We should figure out why and fix them.
The text was updated successfully, but these errors were encountered: