Initial commit
[io-compress-brotli.git] / t / IO-Uncompress-Brotli.t
CommitLineData
f9995f31
MG
1#!/usr/bin/perl
2use v5.14;
3use warnings;
4
5use Test::More tests => 81;
6use File::Slurp;
7BEGIN{ use_ok('IO::Uncompress::Brotli'); }
8
9my $todo_re = qr/empty\.compressed\.(?:1[7-9]|2)|x\.compressed\.0[12]/;
10
11for my $test (<t/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.010053 seconds and 4 git commands to generate.