File Coverage

blib/lib/IO/Uncompress/Brotli.pm
Criterion Covered Total %
statement 16 16 100.0
branch 2 2 100.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 24 24 100.0


line stmt bran cond sub pod time code
1             package IO::Uncompress::Brotli;
2              
3 3     3   185451 use 5.008000;
  3         12  
4 3     3   18 use strict;
  3         6  
  3         157  
5 3     3   21 use warnings;
  3         4  
  3         193  
6 3     3   16 use parent qw/Exporter/;
  3         12  
  3         35  
7              
8             our @EXPORT = qw/unbro/;
9             our @EXPORT_OK = @EXPORT;
10              
11             our $VERSION = '0.019';
12              
13             require XSLoader;
14             XSLoader::load('IO::Compress::Brotli', $VERSION);
15              
16             # 0.004001 has unbro with prototype $$
17             # 0.004_002 renames it to unbro_given_size, and provides unbro with
18             # prototype $;$ which calls:
19             # * unbro_given_size when called with two arguments
20             # * the OO interface when called with one argument
21             sub unbro ($;$) {
22 130     130 1 18353022 my ($buffer, $decoded_size) = @_;
23 130 100       596 if (defined $decoded_size) {
24 86         75405 return unbro_given_size($buffer, $decoded_size)
25             } else {
26 44         656 my $bro = IO::Uncompress::Brotli->create;
27 44         39909 return $bro->decompress($buffer);
28             }
29             }
30              
31             1;
32             __END__