File Coverage

examples/compress-zlib/filtdef
Criterion Covered Total %
statement 20 20 100.0
branch 3 6 50.0
condition n/a
subroutine 3 3 100.0
pod n/a
total 26 29 89.6


line stmt bran cond sub pod time code
1             #!/usr/local/bin/perl
2              
3 2     2   9745 use strict ;
  2         4  
  2         73  
4 2     2   8 use warnings ;
  2         3  
  2         87  
5              
6 2     2   1330 use Compress::Zlib ;
  2         11  
  2         4345  
7              
8 2         436273 binmode STDIN;
9 2         6 binmode STDOUT;
10 2 50       16 my $x = deflateInit()
11             or die "Cannot create a deflation stream\n" ;
12              
13 2         5 my ($output, $status) ;
14 2         246 while (<>)
15             {
16 30         64 ($output, $status) = $x->deflate($_) ;
17              
18 30 50       51 $status == Z_OK
19             or die "deflation failed\n" ;
20              
21 30         296 print $output ;
22             }
23              
24 2         11 ($output, $status) = $x->flush() ;
25              
26 2 50       20 $status == Z_OK
27             or die "deflation failed\n" ;
28              
29 2         0 print $output ;