Branch Coverage

blib/lib/Iterator/Files.pm
Criterion Covered Total %
branch 40 54 74.0


line true false branch
158 3 13 if (exists $args{'magic'})
160 0 3 unless $$self{'_magic'} =~ /^none|all|stdin$/
163 3 13 if (exists $args{'edit'})
165 1 2 if defined $$self{'_edit'} and $$self{'_edit'} eq ''
168 15 0 if (exists $args{'files'})
170 0 15 unless ref $$self{'_files'} eq 'ARRAY'
174 0 15 if (exists $args{'record_separator'})
177 0 15 if (exists $args{'rs'})
180 0 15 if (%args)
204 29 48 unless ($$self{'_init'})
205 13 16 unless $self->_advance
208 64 0 if ($$self{'_init'})
210 48 16 if defined $line
220 57 2 unless wantarray
245 2 33 if (defined $$self{'_edit'} and defined $$self{'_rewrite_fh'})
246 0 2 unless close $$self{'_rewrite_fh'}
254 17 18 unless (@{$$self{'_files'};})
260 3 15 if ($$self{'_magic'} eq 'all' or $$self{'_magic'} eq 'stdin' and $self->current_file eq '-') { }
262 0 3 unless open $$self{'_current_fh'}, $self->current_file
266 0 15 unless open $$self{'_current_fh'}, '<', $self->current_file
270 0 18 if (eof $$self{'_current_fh'})
277 2 16 if (defined $$self{'_edit'})
280 2 0 if (not $$self{'_edit'} =~ /\*/) { }
287 0 2 unless rename $fname, $backup
289 0 2 unless open $$self{'_rewrite_fh'}, '>', $fname
311 6 6 unless not $self->is_eof
329 14 4 unless not defined $fh