mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-10 18:35:35 +08:00
unify tests for all compression extensions
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user