Branch Coverage

blib/lib/App/PTP/Commands.pm
Criterion Covered Total %
branch 115 162 70.9


line true false branch
51 2 4 if ($safe and $options->{'preserve_perl_env'} and $safe->reval('$PerlEnv_LOADED'))
53 2 0 if $options->{'debug_mode'}
56 29 0 if $options->{'debug_mode'}
59 14 15 if ($options->{'use_safe'} > 1) { }
66 0 29 if ($@)
76 2 0 if ($options->{'preserve_perl_env'} and $App::PTP::SafeEnv::PerlEnv_LOADED)
77 2 0 if $options->{'debug_mode'}
80 115 0 if $options->{'debug_mode'}
91 0 115 if ($@)
108 128 20 if (ref $file_name) { }
115 31 117 if ($options->{'use_safe'} > 0) { }
127 148 0 if ($options->{'debug_mode'})
131 3 145 if @$content > 10
132 128 20 if (ref $file_name) { }
137 9 139 $missing_final_separator ? :
147 197 0 if ($options->{'debug_mode'})
158 0 12 if ($modes->{'quote_regex'})
161 0 12 unless ($modes->{'case_sensitive'})
174 0 12 if ($modes->{'regex_engine'} ne 'perl') { }
183 0 0 if ($@)
195 7 68 if ($modes->{'quote_regex'}) { }
206 1 55 unless ($modes->{'case_sensitive'})
210 0 56 if ($modes->{'regex_engine'} ne 'perl')
219 6 6 unless ($modes->{'quote_regex'})
221 0 6 if $@
230 37 0 if $options->{'debug_mode'}
239 141 77 if (not defined $content->[$i]) { }
0 77 elsif (not defined $markers->[$i]) { }
251 19 0 if ($options->{'debug_mode'})
256 18 1 $modes->{'global_match'} ? :
257 19 0 if ($options->{'debug_mode'})
271 213 3 unless $@
273 0 3 if ($modes->{'fatal_error'}) { }
283 0 151 if ($options->{'debug_mode'} > 1)
286 61 90 if ($options->{'use_safe'} > 0) { }
299 0 121 if $@
316 3 198 if (warn_or_die_if_needed("Perl code failed in $scmd", $modes)) { }
330 18 42 if ($cmd eq 'perl') { }
29 13 elsif ($cmd eq 'n') { }
6 7 elsif ($cmd eq 'filter') { }
7 0 elsif ($cmd eq 'mark-line') { }
336 12 11 if (not $result[$i] xor $modes->{'inverse_match'})
347 12 189 if (not defined $content->[$i]) { }
6 183 elsif (not defined $markers->[$i]) { }
359 1 20 if $cmd eq 'M'
361 2 19 if ($@)
374 3 0 if $options->{'debug_mode'}
375 0 3 if (not defined eval_in_safe_env("do '${abs_path}';", $options))
376 0 0 if ($@) { }
0 0 elsif ($!) { }
386 0 9 if (ref $modes->{'comparator'} eq 'CODE') { }
7 2 elsif (ref $modes->{'comparator'} eq 'SCALAR') { }
390 5 2 if (${$modes->{'comparator'};} eq 'default') { }
1 1 elsif (${$modes->{'comparator'};} eq 'numeric') { }
1 0 elsif (${$modes->{'comparator'};} eq 'locale') { }
404 0 2 if ref $modes->{'comparator'}
416 0 2 if ($apply_on_markers) { }
425 1 3 unless $len
432 1 3 unless $len
433 1 3 if $len < -@$content
445 6 6 if ($markers_temp[$i])
461 3 0 unless ($modes->{'quote_regex'})
466 6 6 unless $markers_temp[$i]
468 0 6 if ($modes->{'quote_regex'}) { }
476 0 6 if warn_or_die_if_needed('String interpolation failed in --insert-marked', $modes)
483 0 6 if $target < $added
484 0 6 if $target > @$content
506 2 3 if (ref $modes->{'file_name_ref'} eq 'SCALAR') { }
3 0 elsif (ref $modes->{'file_name_ref'} eq 'REF' and ref ${$modes->{'file_name_ref'};} eq 'SCALAR') { }
515 2 3 if ($replace_all) { }
517 1 1 if (@$content)
536 5 0 if ($options->{'debug_mode'})
539 19 5 if $_
546 19 5 $_ ? :
559 0 0 if (@$content > @$markers)
569 2 5 if ($action eq 'transpose') { }
4 1 elsif ($action eq 'pivot') { }
1 0 elsif ($action eq 'anti-pivot') { }
601 0 6 unless $command eq 'shell'
605 0 6 unless open my $pipe, '|-', $arg
609 0 6 unless close $pipe