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)
144 55 15 if keys %{$$self{'files'};} == 0
155 5 12 defined $self->{'limit'} ? :
157 1 16 unless ($insert)
163 1 11 unless (defined $line or defined $find)
168 1 14 if (defined $line and defined $find)
175 4 10 if (defined $line)
176 1 3 unless ($line =~ /^[0-9]+$/)
183 10 3 if (defined $find and not defined $line)
184 10 0 if !ref($find) ne 'Regexp'
191 21 54 if (/$find/)
194 17 4 if ($limit)
195 9 8 if $inserts == $limit
213 8 10 if ($self->{'types'}) { }
222 6 12 if $self->{'maxdepth'}
228 8 10 if $self->{'list'}
240 14 9 defined $recsep ? :
252 221 5 ref $_[0] eq 'File::Edit::Portable' ? :
264 9 217 if ($@ or -z $fh)
273 4 5 $want ? :
280 217 0 if (<$fh> =~ /$recsep_regex/)
284 0 217 unless close $fh
288 105 112 $want ? :
291 183 0 ref $_[0] eq 'File::Edit::Portable' ? :
302 0 183 unless open my $wfh, '>', $file
308 0 183 unless close $wfh
315 183 0 if (<$fh> =~ /$recsep_regex/)
319 0 183 unless close $fh
324 58 125 $want ? :
362 16 38 if ($self->recsep($file, 'hex') ne $self->platform_recsep('hex')) { }
375 0 16 unless close $fh
376 0 16 unless close $temp_wfh
396 71 537 if ($mode =~ /^w/) { }
397 0 71 unless open $fh, '>', $file
401 7 530 unless open $fh, '<', $file
417 152 23 if $want eq 'hex'
453 0 186 unless close $temp_fh