File: 006.phpt

package info (click to toggle)
php-zstd 0.14.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,536 kB
  • sloc: ansic: 30,009; asm: 382; xml: 179; makefile: 3
file content (27 lines) | stat: -rw-r--r-- 586 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--TEST--
unexpected exiting when uncompress the wrong format data
--SKIPIF--
--FILE--
<?php
$str = 'message string';
$input = base64_decode($str);

echo "*** Compress and Uncompress ***", PHP_EOL;
$output = zstd_uncompress(zstd_compress($input));
var_dump($input === $output);

echo "*** Uncompress ***", PHP_EOL;
$output = zstd_uncompress($input);
var_dump($input === $output);
var_dump($output);
?>
===Done===
--EXPECTF--
*** Compress and Uncompress ***
bool(true)
*** Uncompress ***

Warning: zstd_uncompress(): it was not compressed by zstd in %s
bool(false)
bool(false)
===Done===