Skip to content

Commit

Permalink
Fix rounding error in RectangleTest
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Sep 29, 2023
1 parent 4f51d8f commit 166d2f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/Geometry/RectangleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ public function testSetHeight(): void
public function testGetAspectRatio()
{
$size = new Rectangle(800, 600);
$this->assertEquals(1.33333333333, $size->getAspectRatio());
$this->assertEquals(1.333, round($size->getAspectRatio(), 3));

$size = new Rectangle(100, 100);
$this->assertEquals(1, $size->getAspectRatio());

$size = new Rectangle(1920, 1080);
$this->assertEquals(1.777777777778, $size->getAspectRatio());
$this->assertEquals(1.778, round($size->getAspectRatio(), 3));
}

public function testFitsInto()
Expand Down

0 comments on commit 166d2f3

Please sign in to comment.