]> iEval git - io-compress-brotli.git/blob - t/IO-Uncompress-Brotli.t
94141c125361687728ee777db4bf6e372a9ba453
[io-compress-brotli.git] / t / IO-Uncompress-Brotli.t
1 #!/usr/bin/perl
2 use v5.14;
3 use warnings;
4
5 use Test::More tests => 81;
6 use File::Slurp;
7 BEGIN{ use_ok('IO::Uncompress::Brotli'); }
8
9 my $todo_re = qr/empty\.compressed\.(?:1[7-9]|2)|x\.compressed\.0[12]/;
10
11 for my $test (<brotli/tests/testdata/*.compressed*>) {
12 my ($expected) = $test =~ s/\.compressed.*//r;
13 $expected = read_file $expected;
14
15 if($test !~ $todo_re) {
16 my $decoded = unbro (scalar read_file $test);
17 is $decoded, $expected, "$test";
18 }
19
20 open FH, '<', $test;
21 my $unbro = IO::Uncompress::Brotli->create;
22 my ($buf, $out);
23 until (eof FH) {
24 read FH, $buf, 100;
25 $out .= $unbro->decompress($buf);
26 }
27 is $out, $expected, "$test (streaming)";
28 }
This page took 0.049184 seconds and 3 git commands to generate.