mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-23 00:35:38 +08:00
unify tests for all compression extensions
This commit is contained in:
15
src/globals/ext-tests/zstd.php
Normal file
15
src/globals/ext-tests/zstd.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
assert(function_exists('zstd_compress'));
|
||||
assert(function_exists('zstd_uncompress'));
|
||||
|
||||
$input = str_repeat('The quick brown fox jumps over the lazy dog. ', 10);
|
||||
$compressed = zstd_compress($input);
|
||||
assert(is_string($compressed));
|
||||
assert(strlen($compressed) < strlen($input));
|
||||
|
||||
$uncompressed = zstd_uncompress($compressed);
|
||||
assert(is_string($uncompressed));
|
||||
assert($uncompressed === $input);
|
||||
Reference in New Issue
Block a user