Please test your tests

This commit is contained in:
Rasmus Lerdorf 2012-01-23 06:39:01 +00:00
parent e718c53223
commit 0116466974

View File

@ -1,35 +1,35 @@
--TEST--
checks zlib compression size is always the same no matter how many times its run
--SKIPIF--
<?php if (!extension_loaded("zlib")) print "skip"; ?>
--FILE--
<?php
ob_start();
phpinfo();
$html = ob_get_clean();
$lens = array();
for ( $i=0 ; $i < 200 ; $i++ ) {
//zlib.output_compression = On
//zlib.output_compression_level = 9
$compressed = gzcompress($html, 9);
$len = strlen($compressed);
$lens[$len] = $len;
}
$lens = array_values($lens);
echo "Compressed lengths\n";
var_dump($lens);
?>
--EXPECTREGEX--
Compressed lengths
array(1) {
[0]=>
int(%d)
}
--TEST--
checks zlib compression size is always the same no matter how many times its run
--SKIPIF--
<?php if (!extension_loaded("zlib")) print "skip"; ?>
--FILE--
<?php
ob_start();
phpinfo();
$html = ob_get_clean();
$lens = array();
for ( $i=0 ; $i < 200 ; $i++ ) {
//zlib.output_compression = On
//zlib.output_compression_level = 9
$compressed = gzcompress($html, 9);
$len = strlen($compressed);
$lens[$len] = $len;
}
$lens = array_values($lens);
echo "Compressed lengths\n";
var_dump($lens);
?>
--EXPECTF--
Compressed lengths
array(1) {
[0]=>
int(%d)
}