Branch Coverage

blib/lib/Config/Patch.pm
Criterion Covered Total %
branch 108 166 65.0


line true false branch
28 60 0 if (not defined *{"${package}::$name";})
29 0 60 unless eval $code
0 16 if (defined $value)
16 0 if (exists $$self{'content_pos_from'}) { }
12 30 if (defined $value)
42 0 if (exists $$self{'comment_char'}) { }
0 21 if (defined $value)
21 0 if (exists $$self{'header'}) { }
0 22 if (defined $value)
22 0 if (exists $$self{'regex'}) { }
0 13 if (defined $value)
13 0 if (exists $$self{'content_pos_to'}) { }
0 54 if (defined $value)
54 0 if (exists $$self{'pos_from'}) { }
11 38 if (defined $value)
49 0 if (exists $$self{'key'}) { }
0 2 if (defined $value)
2 0 if (exists $$self{'as_string'}) { }
0 8 if (defined $value)
8 0 if (exists $$self{'data'}) { }
0 25 if (defined $value)
25 0 if (exists $$self{'mode'}) { }
5 11 if (defined $value)
16 0 if (exists $$self{'file'}) { }
2 12 if (defined $value)
14 0 if (exists $$self{'pos_to'}) { }
0 3 if (defined $value)
3 0 if (exists $$self{'method'}) { }
1 39 if (defined $value)
40 0 if (exists $$self{'text'}) { }
0 59 if (defined $value)
59 0 if (exists $$self{'key'}) { }
117 9 0 if ($text =~ /^$replace_marker\n(.*?) ^$replace_marker/msx)
194 0 21 if (defined $file)
201 0 21 unless substr($$self{'data'}, -1, 1) eq "\n"
214 0 0 if (defined $text[0])
227 0 6 unless defined $$self{'key'}
230 0 6 unless defined $mode
248 1 14 unless $$self{'read'}
260 1 14 if ($$patch{'mode'} eq 'prepend') { }
5 9 elsif ($$patch{'mode'} eq 'append') { }
2 7 elsif ($$patch{'mode'} eq 'replace') { }
4 3 elsif ($$patch{'mode'} eq 'insert-before') { }
1 2 elsif ($$patch{'mode'} eq 'insert-after') { }
2 0 elsif ($$patch{'mode'} eq 'update') { }
0 0 elsif ($$patch{'mode'} eq 'comment_out') { }
301 0 0 unless defined $file
314 1 19 if (grep {$key eq $_->key;} @patches)
351 2 0 if (length $newvalue and substr($newvalue, -1, 1) ne "\n")
359 0 3 if $hunk->key ne $key
388 1 19 if ($self->patched($$self{'key'}))
393 0 19 if (ref $search ne 'Regexp')
397 10 9 if (length $replace and substr($replace, -1, 1) ne "\n")
419 8 13 if ($mode eq 'insert') { }
13 0 elsif ($mode eq 'replace') { }
420 2 6 if ($after) { }
474 4 22 unless (Set::IntSpan::empty($intersect))
484 12 10 if $first
495 1 21 if (@positions and $positions[-1][1] > $first)
520 0 19 unless $$self{'read'}
523 1 18 if (ref $key eq 'Config::Patch::Hunk')
527 14 5 unless defined $key
537 20 1 if ($patch->key eq $key) { }
538 9 11 if ($patch->mode eq 'replace') { }
577 108 196 if $in_patch and not $_ =~ /$$self{'patch_regex'}/
580 130 108 unless ($_ =~ /$$self{'patch_regex'}/ or $in_patch)
585 33 271 if ($_ =~ /$$self{'patch_regex'}/ and $in_patch)
608 66 238 if ($_ =~ /$$self{'patch_regex'}/)
609 33 33 if ($in_patch) { }
622 34 12 if length $text
632 0 51 unless open FILE, ">$file"
643 0 46 unless open FILE, "<$file"
656 33 0 unless $$self{'flock'}
659 0 0 if ($$self{'locked'})
664 0 0 unless open my $fh, "+<$$self{'file'}"
680 33 0 unless $$self{'flock'}
682 0 0 unless ($$self{'locked'})
687 0 0 if ($$self{'locked'} > 1)
739 1 0 unless $$self{'read'}
756 4 1 unless $$self{'read'}
773 9 2 unless $$self{'read'}
789 2 0 unless $$self{'read'}
805 3 11 unless $$self{'read'}