<commit_before><commit_msg>- add gzip stream filter test<commit_after>--TEST--
gzip stream filters
--SKIPIF--
<?php
include 'skip.inc';
checkver(5);
skipif(!http_support(HTTP_SUPPORT_ENCODINGS), "need zlib support");
?>
--FILE--
<?php

echo "-TEST\n";

$d = file_get_contents(__FILE__);
$n = tempnam(dirname(__FILE__), 'hsf');

$f = fopen($n, 'wb');
stream_filter_append($f, 'http.gzencode', STREAM_FILTER_WRITE);
fwrite($f, $d);
fflush($f);
fclose($f);
$gzencoded = file_get_contents($n);

$f = fopen($n, 'wb');
stream_filter_append($f, 'http.deflate', STREAM_FILTER_WRITE);
fwrite($f, $d);
fflush($f);
fclose($f);
$deflated = file_get_contents($n);

var_dump($d == http_gzdecode($gzencoded));
var_dump($d == http_inflate($deflated));

echo "Done\n";
?>
--EXPECTF--
%sTEST
bool(true)
bool(true)
Done
{'fraction_non_alphanumeric': 0.2125, 'fraction_numerical': 0.00125, 'mean_word_length': 6.930693069306931, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7563459', 'n_tokens_mistral': 326, 'n_tokens_neox': 325, 'n_words': 62}