Skip to content

Commit 9282503

Browse files
committed
add test
1 parent 6339668 commit 9282503

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

ext/gmp/tests/gmp_pow_fpe.phpt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ gmp
66
<?php
77
$g = gmp_init(256);
88

9-
var_dump(gmp_pow($g, PHP_INT_MAX));
10-
var_dump(gmp_pow(256, PHP_INT_MAX));
11-
?>
12-
--EXPECTF--
13-
object(GMP)#2 (1) {
14-
["num"]=>
15-
string(%d) "%s"
9+
try {
10+
gmp_pow($g, PHP_INT_MAX);
11+
} catch (\ValueError $e) {
12+
echo $e->getMessage() . PHP_EOL;
1613
}
17-
object(GMP)#2 (1) {
18-
["num"]=>
19-
string(%d) "%s"
14+
try {
15+
gmp_pow(256, PHP_INT_MAX);
16+
} catch (\ValueError $e) {
17+
echo $e->getMessage();
2018
}
19+
?>
20+
--EXPECT--
21+
base and exponent overflow
22+
base and exponent overflow

0 commit comments

Comments
 (0)