Skip to content

Commit 0f6cb1f

Browse files
committed
Improve pow() tests
1 parent 5dfb2d9 commit 0f6cb1f

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

ext/standard/tests/math/pow_variation1.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ $inputs = array(
6262
/*20*/ "abcxyz",
6363
'abcxyz',
6464
$heredoc,
65+
'10.5',
66+
'2',
6567

6668
// object data
6769
/*23*/ new classA(),

ext/standard/tests/math/pow_variation1_64bit.phpt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ $inputs = array(
6262
/*20*/ "abcxyz",
6363
'abcxyz',
6464
$heredoc,
65+
'10.5',
66+
'2',
6567

6668
// object data
6769
/*23*/ new classA(),
@@ -159,13 +161,19 @@ Unsupported operand types: string ** int
159161
Unsupported operand types: string ** int
160162

161163
-- Iteration 23 --
162-
Unsupported operand types: classA ** int
164+
float(1157.625)
163165

164166
-- Iteration 24 --
165-
int(0)
167+
int(8)
166168

167169
-- Iteration 25 --
168-
int(0)
170+
Unsupported operand types: classA ** int
169171

170172
-- Iteration 26 --
173+
int(0)
174+
175+
-- Iteration 27 --
176+
int(0)
177+
178+
-- Iteration 28 --
171179
Unsupported operand types: resource ** int

ext/standard/tests/math/pow_variation2.phpt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $inputs = array(
3030
1,
3131
12345,
3232
-2345,
33-
2147483647,
33+
PHP_INT_MAX,
3434

3535
// float data
3636
/*6*/ 2.5,
@@ -58,6 +58,8 @@ $inputs = array(
5858
/*20*/ "abcxyz",
5959
'abcxyz',
6060
$heredoc,
61+
'10.5',
62+
'2',
6163

6264
// object data
6365
/*23*/ new classA(),
@@ -155,13 +157,19 @@ Unsupported operand types: float ** string
155157
Unsupported operand types: float ** string
156158

157159
-- Iteration 23 --
158-
Unsupported operand types: float ** classA
160+
float(53543702391195)
159161

160162
-- Iteration 24 --
161-
float(1)
163+
float(412.09)
162164

163165
-- Iteration 25 --
164-
float(1)
166+
Unsupported operand types: float ** classA
165167

166168
-- Iteration 26 --
169+
float(1)
170+
171+
-- Iteration 27 --
172+
float(1)
173+
174+
-- Iteration 28 --
167175
Unsupported operand types: float ** resource

0 commit comments

Comments
 (0)