Skip to content

Commit

Permalink
Set delta for testing floats with precision
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkBaker committed Mar 7, 2022
1 parent f95ecca commit 719d01c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion unitTests/classes/src/BaseTestAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ protected function assertMatrixValues(Matrix $matrix, $rows, $columns, array $gr
$matrixGrid = $matrix->toArray();
foreach ($grid as $row => $vector) {
foreach ($vector as $column => $expectedValue) {
self::assertSame(
self::assertEqualsWithDelta(
(float) $expectedValue,
(float) $matrixGrid[$row][$column],
1.0e-12,
"Invalid result at row {$row} and column {$column}"
);
}
Expand Down

0 comments on commit 719d01c

Please sign in to comment.