-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
FormatterNumberTest::testIntlAsScientific fails on GitLab #17708
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
Just noticed: Test worked on PHP 7.1.26 |
So is there a change between that and PHP 7.1.33 that causes one extra digit to appear? |
Has precision setting been changed in php.ini? |
I triggered tests for all versions in question at https://gitlab.com/yiisoft/yii2-docker/pipelines I have not changed anything in our files. |
Tests fail for 7.1.30 PHP Changelog says: Version 7.1.30 |
Debian version has been changed:
and likely some system-lib. Which one would be responsible for that? |
No idea :( |
Most likely precision setting has been changed. Maybe we should adjust tests to not rely on OS default settings. |
It's the same...
|
I don't think the precision setting of PHP is used by |
I would try:
Its rather strange |
So... ICU version changed? |
Diff between ini .29 and .30
How do I get ICU versions? |
Seems to me like a bug in Yii. Maybe would be good to set defaults. The info at the function
|
|
Changelog here for ICU 60 (http://site.icu-project.org/download/60) mentions the NumberFormatter code has been redone and the old api is now a wrapper to the new. |
Good find!
|
@samdark How should this be fixed? |
IMHO; either there should be a global default for precision, or the test should specify it. |
Test specifying it sounds fine to me. |
@My6UoT9 want to do a pull request? |
Yes will do a pr tomorrow morning, but I do not have the time to locally test it, I have the yii2 project not setup in that way. |
Interesting, phpunit did not need any setup, so I did run it too.. and got same issue:
|
$formatter = new NumberFormatter('en-US', NumberFormatter::SCIENTIFIC);
$formatter->setAttribute(NumberFormatter::MIN_FRACTION_DIGITS, 10);
$formatter->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, 10);
echo $formatter->format('87654321098765436');
echo "\n";
echo $formatter->getPattern(); |
Not only precision varies with ICU version. The interpretation of fraction digits does as well. 3 means 8.76E16 in one instance and 8.765E16 in another. |
Overall conclusion is that the test is doing more harm than good. Going to mark it as always skipped. |
@schmunk42 it's merged. Would you please handle Docker part? |
For reference, tested via trigger
|
What steps will reproduce the problem?
See tests here: https://gitlab.com/yiisoft/yii2/-/jobs/368388365
What is the expected result?
No failure or error.
What do you get instead?
Additional info
Looks like there's one more digit now?!
Test fails since https://gitlab.com/yiisoft/yii2/commit/c1e9739ed232e207ff6920e90b7351b2b19f69d0
Pipelines: https://gitlab.com/yiisoft/yii2/pipelines
The text was updated successfully, but these errors were encountered: