Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Oct 17, 2024
1 parent 6339668 commit 9282503
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions ext/gmp/tests/gmp_pow_fpe.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ gmp
<?php
$g = gmp_init(256);

var_dump(gmp_pow($g, PHP_INT_MAX));
var_dump(gmp_pow(256, PHP_INT_MAX));
?>
--EXPECTF--
object(GMP)#2 (1) {
["num"]=>
string(%d) "%s"
try {
gmp_pow($g, PHP_INT_MAX);
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
}
object(GMP)#2 (1) {
["num"]=>
string(%d) "%s"
try {
gmp_pow(256, PHP_INT_MAX);
} catch (\ValueError $e) {
echo $e->getMessage();
}
?>
--EXPECT--
base and exponent overflow
base and exponent overflow

0 comments on commit 9282503

Please sign in to comment.