unify tests for all compression extensions

This commit is contained in:
DubbleClick
2025-06-05 20:07:55 +07:00
parent 17b4c18830
commit 01a79fcc6e
5 changed files with 53 additions and 8 deletions

View File

@@ -2,7 +2,14 @@
declare(strict_types=1);
$str = 'This is bz2 extension test';
assert(function_exists('bzdecompress'));
assert(function_exists('bzcompress'));
assert(bzdecompress(bzcompress($str, 9)) === $str);
assert(function_exists('bzdecompress'));
$input = str_repeat('The quick brown fox jumps over the lazy dog. ', 10);
$compressed = bzcompress($input);
assert(is_string($compressed));
assert(strlen($compressed) < strlen($input));
$uncompressed = bzdecompress($compressed);
assert(is_string($uncompressed));
assert($uncompressed === $input);