Branch Coverage

blib/lib/File/Edit/Portable.pm
Criterion Covered Total %
branch 88 102 86.2


line true false branch
29 8 104 if ($_[0] eq 'file') { }
34 2 102 if @_
41 1 111 unless ($file)
52 54 57 if (not wantarray) { }
59 0 57 unless close $fh
61 55 2 unless ($testing)
74 2 74 unless ($self->{'file'})
80 2 72 if ($reads_count > 1 and not $p{'file'})
86 1 71 unless ($self->{'contents'})
92 6 65 unless ($self->{'files'}{$file}{'is_read'})
96 45 26 if $self->{'copy'}
105 71 0 unless ($os[0] eq "FreeBSD" and $os[-1] eq "amd64")
111 32 39 defined $self->{'custom_recsep'} ? :
115 49 22 if (ref $contents eq 'GLOB' or ref $contents eq 'File::Temp') { }
122 1 48 if ($warn)
143 55 15 if keys %{$$self{"files"};} == 0
154 5 12 defined $self->{'limit'} ? :
156 1 16 unless ($insert)
162 1 11 unless (defined $line or defined $find)
167 1 14 if (defined $line and defined $find)
174 4 10 if (defined $line)
175 1 3 unless ($line =~ /^[0-9]+$/)
182 10 3 if (defined $find and not defined $line)
183 10 0 if !ref($find) ne "Regexp"
190 21 54 if (/$find/)
193 17 4 if ($limit)
194 9 8 if $inserts == $limit
212 8 10 if ($self->{'types'}) { }
221 6 12 if $self->{'maxdepth'}
227 8 10 if $self->{'list'}
239 14 9 defined $recsep ? :
251 221 5 ref $_[0] eq 'File::Edit::Portable' ? :
263 9 217 if ($@ or -z $fh)
272 4 5 $want ? :
279 217 0 if (readline($fh) =~ /$recsep_regex/)
283 0 217 unless close $fh
287 105 112 $want ? :
290 183 0 ref $_[0] eq 'File::Edit::Portable' ? :
301 0 183 unless open my $wfh, ">", $file
307 0 183 unless close $wfh
314 183 0 if (readline($fh) =~ /$recsep_regex/)
318 0 183 unless close $fh
321 0 183 unless unlink $file
325 58 125 $want ? :
363 16 38 if ($self->recsep($file, 'hex') ne $self->platform_recsep('hex')) { }
376 0 16 unless close $fh
377 0 16 unless close $temp_wfh
397 71 537 if ($mode =~ /^w/) { }
398 0 71 unless open $fh, ">", $file
402 7 530 unless open $fh, "<", $file
418 152 23 if $want eq "hex"