Branch Coverage

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


line true false branch
32 0 138 if ($options->{'output'}) { }
138 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 138 0 if $options->{'debug_mode'}
51 0 136 if ($options->{'output'})
52 0 0 unless close $global_output_fh
67 0 155 unless (defined $content)
68 0 0 if ($@)
77 1 154 if ($options->{'preserve_eol'}) { }
83 10 145 if ((pos $content // 0) < length $content)
85 10 0 if $options->{'debug_mode'}
95 26 0 if $options->{'debug_mode'}
96 0 26 unless open my $fh, "<:encoding($options->{'input_encoding'})", $path
99 0 26 unless close $fh
107 129 0 if $options->{'debug_mode'}
118 129 26 if (ref $input)
119 129 0 if ($input == \$stdin_marker) { }
131 6 156 unless @$content
134 150 6 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 150 if ($options->{'in_place'}) { }
168 6 0 if $options->{'debug_mode'}
169 0 6 if ($file_name eq '-') { }
180 0 0 if ($input eq '-') { }