Skip to content

Commit d63c8a5

Browse files
authored
split long tests into separate parts (#1449)
1 parent 853e982 commit d63c8a5

File tree

6 files changed

+64
-10
lines changed

6 files changed

+64
-10
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@ok benchmark
2+
<?php
3+
4+
require_once dirname(__FILE__) . '/include/test-json.php';
5+
6+
test_json (JSON_UNESCAPED_UNICODE);
7+
test_json (JSON_UNESCAPED_SLASHES);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@ok benchmark
2+
<?php
3+
4+
require_once dirname(__FILE__) . '/include/test-json.php';
5+
6+
test_json (0);
7+
test_json (JSON_PARTIAL_OUTPUT_ON_ERROR);

tests/phpt/dl/483_bcmath.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,3 @@ function gen_numbers($seed) {
276276
test_bcmod($mid_nums);
277277
test_bcmod($big_nums);
278278
test_bcmod($math_constants);
279-
280-
$powers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 99, 100];
281-
test_bcpow($low_nums, $powers);
282-
test_bcpow($mid_nums, $powers);
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
function test_bcpow($nums, $powers) {
4+
foreach ($nums as $base) {
5+
foreach ($powers as $power) {
6+
echo bcpow($base, $power), "\n";
7+
echo bcpow(-$base, $power), "\n";
8+
echo bcpow($base, -$power), "\n";
9+
echo bcpow(-$base, -$power), "\n";
10+
11+
for ($i = 0; $i < 20; ++$i) {
12+
echo bcpow($base, $power, $i), "\n";
13+
echo bcpow(-$base, $power, $i), "\n";
14+
echo bcpow($base, -$power, $i), "\n";
15+
echo bcpow(-$base, -$power, $i), "\n";
16+
}
17+
}
18+
}
19+
}
20+
21+
$low_nums = [-0, +0, 0, 0.1234046, 0.123, 0.1, 0.0, 0., .0, 0.0001, 0.2, 0.2001, 0.000100000345, 00.01, 000.1000305020100];
22+
23+
$powers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 99, 100];
24+
test_bcpow($low_nums, $powers);
25+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
function test_bcpow($nums, $powers) {
4+
foreach ($nums as $base) {
5+
foreach ($powers as $power) {
6+
echo bcpow($base, $power), "\n";
7+
echo bcpow(-$base, $power), "\n";
8+
echo bcpow($base, -$power), "\n";
9+
echo bcpow(-$base, -$power), "\n";
10+
11+
for ($i = 0; $i < 20; ++$i) {
12+
echo bcpow($base, $power, $i), "\n";
13+
echo bcpow(-$base, $power, $i), "\n";
14+
echo bcpow($base, -$power, $i), "\n";
15+
echo bcpow(-$base, -$power, $i), "\n";
16+
}
17+
}
18+
}
19+
}
20+
21+
$mid_nums = ["", 1, 1.0, 1.00, 1.01, 1.001, 2, 2.0, 2.00, 2.01, 2.001, 2.0001, 2.00010003, 3, 4, 5, 6, 7, 8, 9,
22+
9.12342135234234234, 9.12342135, 9.123, 9.1, 9.10, 9.100, 9.0, 9.00, 09.00, 009.00, 009.001, 9.00000001, 9.000000013445];
23+
24+
$powers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 99, 100];
25+
test_bcpow($mid_nums, $powers);
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@ok benchmark
21
<?php
32

43
function test_json ($options) {
@@ -129,8 +128,3 @@ function test_json ($options) {
129128

130129
var_dump (count($data));
131130
}
132-
133-
test_json (0);
134-
test_json (JSON_UNESCAPED_UNICODE);
135-
test_json (JSON_UNESCAPED_SLASHES);
136-
test_json (JSON_PARTIAL_OUTPUT_ON_ERROR);

0 commit comments

Comments
 (0)