Branch Coverage

blib/lib/App/PTP/Files.pm
Criterion Covered Total %
branch 29 58 50.0


line true false branch
32 0 118 if ($options->{'output'}) { }
118 0 elsif (not $options->{'in_place'}) { }
33 0 0 if ($options->{'debug_mode'})
36 0 0 $options->{'append'} ? :
39 0 0 unless open $global_output_fh, "${mode}:encoding($options->{'output_encoding'})", $options->{'output'}
41 118 0 if $options->{'debug_mode'}
51 0 116 if ($options->{'output'})
52 0 0 unless close $global_output_fh
67 0 134 unless (defined $content)
68 0 0 if ($@)
77 1 133 if ($options->{'preserve_eol'}) { }
83 9 125 if ((pos $content // 0) < length $content)
85 9 0 if $options->{'debug_mode'}
95 23 0 if $options->{'debug_mode'}
96 0 23 unless open my $fh, "<:encoding($options->{'input_encoding'})", $path
99 0 23 unless close $fh
107 111 0 if $options->{'debug_mode'}
118 111 23 if (ref $input)
119 111 0 if ($input == \$stdin_marker) { }
131 4 132 unless @$content
134 127 5 if $options->{'fix_final_separator'} or not $missing_final_separator
142 1 5 $append ? :
143 6 0 if $options->{'debug_mode'}
144 0 6 unless open my $out_fh, "${m}:encoding($options->{'output_encoding'})", $file_name
147 0 6 unless close $out_fh
153 0 130 if ($options->{'in_place'}) { }
168 6 0 if $options->{'debug_mode'}
169 0 6 if ($file_name eq '-') { }
180 0 0 if ($input eq '-') { }