symfony / polyfill

PHP polyfills

Home Page:https://symfony.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tests: invalid comparation of float values

WinterSilence opened this issue · comments

commented

$this->assertEquals() and $this->assertSame() generates error like as
Failed asserting that 3.3333333333333335 is identical to 3.3333333333333. at comparing float values.

Need replace invalid assertion to $this->assertEqualsWithDelta():
$this->assertEqualsWithDelta(3.3333333333333335, 3.3333333333333, 0.0000001)
https://phpunit.readthedocs.io/en/7.5/assertions.html#assertequalswithdelta

What exactly is the issue that you want to report?

commented

@derrabus failed tests/invalid assertion

This is certainly not the right repository.

commented

@nicolas-grekas why? this massive problem for polyfill packages

Sorry I failed to understand that your were talking about the tests of this repo. Now that I see your PR it makes sense.

commented

@nicolas-grekas no problem, but why issue still close? Yes, this PR is "howto" for update same tests