Branch Coverage

blib/lib/IO/File/CompressOnClose.pm
Criterion Covered Total %
branch 58 64 90.6


line true false branch
57 22 3 if (ref $self eq 'IO::File::CompressOnClose') { }
70 9 16 if (@_ > 1) { }
72 1 8 if ($mode =~ /^\d+$/) { }
1 7 elsif ($mode =~ /:/) { }
80 1 6 unless (IO::Handle::_open_mode_string($mode) =~ />/)
86 11 5 if ($file =~ />/)
95 21 1 unless ('File::Spec'->file_name_is_absolute($file))
105 4 18 unless (-f $file)
138 1 21 if $self->compressed
141 6 15 unless $self->compress_on_close
145 1 14 if (ref $compressor eq 'CODE') { }
146 1 0 if &$compressor($self->filename, $self->compress_to)
151 0 14 unless (UNIVERSAL::isa($compressor, 'UNIVERSAL'))
153 0 0 if ($@)
158 8 6 unless (UNIVERSAL::isa($compressor, 'IO::File::CompressOnClose'))
162 1 5 unless (UNIVERSAL::can($compressor, 'compress'))
169 4 1 if $self->compress($self->filename, $self->compress_to)
174 6 0 if ($self->delete_after_compress)
175 0 6 unless (unlink $self->filename)
190 8 18 if ($self->opened)
201 22 20 if @_ > 1
211 8 8 if @_ > 1
221 31 19 if @_ > 1
230 27 32 $${*$self;}{'compress_on_close'} ? :
231 25 34 if (@_ > 1)
232 19 6 $newval ? :
242 11 28 $${*$self;}{'delete_after_compress'} ? :
243 29 10 if (@_ > 1)
244 26 3 $newval ? :
254 4 30 $${*$self;}{'compressed'} ? :
255 8 26 if (@_ > 1)
256 7 1 $newval ? :