Replace File::Slurp with File::Slurper
[io-compress-brotli.git] / t / 01-uncompress.t
... / ...
CommitLineData
1#!/usr/bin/perl
2use v5.14;
3use warnings;
4
5use Test::More tests => 84;
6use File::Slurper qw/read_binary/;
7
8use IO::Uncompress::Brotli;
9
10for my $test (<brotli/tests/testdata/*.compressed*>) {
11 my ($expected) = $test =~ s/\.compressed.*//r;
12 $expected = read_binary $expected;
13
14 my $decoded = unbro ((scalar read_binary $test), 1_000_000);
15 is $decoded, $expected, "$test";
16
17 open FH, '<', $test;
18 my $unbro = IO::Uncompress::Brotli->create;
19 my ($buf, $out);
20 until (eof FH) {
21 read FH, $buf, 100;
22 $out .= $unbro->decompress($buf);
23 }
24 is $out, $expected, "$test (streaming)";
25}
This page took 0.008955 seconds and 4 git commands to generate.