X-Git-Url: http://git.ieval.ro/?p=io-compress-brotli.git;a=blobdiff_plain;f=t%2F01-uncompress.t;h=b8fbc6dba22f4a40ae3388d863c337386db5b527;hp=28907ca0ffd6618acab8d0ddd70e2b1172372fec;hb=799b2a343f40ccc586481aa7b269da5f0abf513f;hpb=56bfd9c0a0380461b810f820869768f4e8a7ad4a diff --git a/t/01-uncompress.t b/t/01-uncompress.t index 28907ca..b8fbc6d 100644 --- a/t/01-uncompress.t +++ b/t/01-uncompress.t @@ -2,19 +2,23 @@ use v5.14; use warnings; -use Test::More tests => 84; -use File::Slurp; +use Test::More tests => 126; +use File::Slurper qw/read_binary/; use IO::Uncompress::Brotli; for my $test () { my ($expected) = $test =~ s/\.compressed.*//r; - $expected = read_file $expected; + $expected = read_binary $expected; - my $decoded = unbro ((scalar read_file $test), 1_000_000); - is $decoded, $expected, "$test"; + my $decoded = unbro ((scalar read_binary $test), 1_000_000); + is $decoded, $expected, "$test (two-argument unbro)"; + + $decoded = unbro scalar read_binary $test; + is $decoded, $expected, "$test (one-argument unbro)"; open FH, '<', $test; + binmode FH; my $unbro = IO::Uncompress::Brotli->create; my ($buf, $out); until (eof FH) {