-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[String] Unexpected codepoints in tests #38957
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
Comments
I have the same errors on my Ubuntu and this is due to a broken ICU release that both OSes ship. Take this one:
Use the text selection in the browser to count the number of chars in that string, you'll find 5, not 4. I didn't investigate which version of what precisely should be skipped, but there is nothing wrong with the code on our side. |
Homebrew currently ships ICU4C 67.1. This is pretty much up to date. I tried to bump to 68.1, but… https://bugs.php.net/80310 |
I could manage to compile php against icu4c 68.1 now, which is the most recent release. I can still reproduce the problem. Do you have any insights? Is this a defect of ICU4C or a problem of PHP not calling ICU correctly? I feel like we should report this to someone. 🤔 |
I don't know if this if for PHP or ICU. Maybe report to both to have a quicker response? |
Hope I can help a bit with the follwing info: As far as I know, macOS uses a different Unicode normalization than "the rest of the world". While Windows and Linux (and probably others) use the Normalization Form Canonical Composition, macOS uses Normalization Form Canonical Decomposition. See also https://gist.github.com/JamesChevalier/8448512 Maybe a workaround would be to compare the normalized Unicode values using the PHP Normalizer, skipping the test if running on macOS and it is not available. |
Hey, thanks for your report! |
The issue also pops up in our PHP 8.1 run on GitHub Actions (Ubuntu 20.04): https://github.com/symfony/symfony/runs/2752189826#step:6:6107 |
Symfony version(s) affected: 5.1-dev
Description
When running test String test suite on macOS, the tests fail because they receive more codepoints than expected.
How to reproduce
Run the String test suite on macOS.
Additional context
Discovered while working on #38620
https://github.com/symfony/symfony/pull/38956/checks?check_run_id=1339604533#step:8:1216
The text was updated successfully, but these errors were encountered: