Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/phpt/dl/1044_test_json_encoding_unescaped_tags.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@ok benchmark
<?php

require_once dirname(__FILE__) . '/include/test-json.php';

test_json (JSON_UNESCAPED_UNICODE);
test_json (JSON_UNESCAPED_SLASHES);
7 changes: 7 additions & 0 deletions tests/phpt/dl/1045_test_json_encoding_tags.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@ok benchmark
<?php

require_once dirname(__FILE__) . '/include/test-json.php';

test_json (0);
test_json (JSON_PARTIAL_OUTPUT_ON_ERROR);
4 changes: 0 additions & 4 deletions tests/phpt/dl/483_bcmath.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,3 @@ function gen_numbers($seed) {
test_bcmod($mid_nums);
test_bcmod($big_nums);
test_bcmod($math_constants);

$powers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 99, 100];
test_bcpow($low_nums, $powers);
test_bcpow($mid_nums, $powers);
25 changes: 25 additions & 0 deletions tests/phpt/dl/483_bcpow_low_nums.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

function test_bcpow($nums, $powers) {
foreach ($nums as $base) {
foreach ($powers as $power) {
echo bcpow($base, $power), "\n";
echo bcpow(-$base, $power), "\n";
echo bcpow($base, -$power), "\n";
echo bcpow(-$base, -$power), "\n";

for ($i = 0; $i < 20; ++$i) {
echo bcpow($base, $power, $i), "\n";
echo bcpow(-$base, $power, $i), "\n";
echo bcpow($base, -$power, $i), "\n";
echo bcpow(-$base, -$power, $i), "\n";
}
}
}
}

$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];

$powers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 99, 100];
test_bcpow($low_nums, $powers);

25 changes: 25 additions & 0 deletions tests/phpt/dl/483_bcpow_mid_nums.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

function test_bcpow($nums, $powers) {
foreach ($nums as $base) {
foreach ($powers as $power) {
echo bcpow($base, $power), "\n";
echo bcpow(-$base, $power), "\n";
echo bcpow($base, -$power), "\n";
echo bcpow(-$base, -$power), "\n";

for ($i = 0; $i < 20; ++$i) {
echo bcpow($base, $power, $i), "\n";
echo bcpow(-$base, $power, $i), "\n";
echo bcpow($base, -$power, $i), "\n";
echo bcpow(-$base, -$power, $i), "\n";
}
}
}
}

$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,
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];

$powers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 99, 100];
test_bcpow($mid_nums, $powers);
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@ok benchmark
<?php

function test_json ($options) {
Expand Down Expand Up @@ -129,8 +128,3 @@ function test_json ($options) {

var_dump (count($data));
}

test_json (0);
test_json (JSON_UNESCAPED_UNICODE);
test_json (JSON_UNESCAPED_SLASHES);
test_json (JSON_PARTIAL_OUTPUT_ON_ERROR);
Loading