Skip to content

Commit cbb3727

Browse files
Merge pull request #193 from paragonie/flaky-test
Fix flaky test for PHP 8.1+
2 parents 810e72b + cf02e05 commit cbb3727

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/unit/UtilTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,13 @@ public function testMul(): void
314314
}
315315

316316
foreach ($arguments as $arg) {
317+
$product = $arg[0] * $arg[1];
318+
if (is_float($product)) {
319+
// Int-to-float is deprecated as of 8.1; this test case is bogus
320+
continue;
321+
}
317322
$this->assertSame(
318-
(int) ($arg[0] * $arg[1]),
323+
(int) $product,
319324
ParagonIE_Sodium_Core_Util::mul($arg[0], $arg[1]),
320325
'Multiplying ' . $arg[0] . ' by ' . $arg[1] . ' failed.'
321326
);

0 commit comments

Comments
 (0)