Branch Coverage

blib/lib/VCS/Lite/Delta.pm
Criterion Covered Total %
branch 102 122 83.6


line true false branch
63 6 7 unless (ref $src)
64 0 6 unless open my $fh, $src
70 7 6 if $atyp eq 'ARRAY'
84 2 4 if (ref $sep eq 'HASH')
91 6 0 if $sep
96 6 0 if ($atyp eq 'GLOB') { }
0 0 elsif ($atyp eq 'SCALAR') { }
116 3 3 if ($diff[0] =~ /^---/)
121 41 51 if $proto{'chomp'}
124 9 83 if ($state eq 'inputdef')
125 3 6 if /^--- # --- \s (\S+)/x
128 3 6 if /^\+{3} # +++ \s (\S+)/x
131 3 6 if /^\@\@/
136 11 81 if ($state eq 'patch')
137 1 10 unless /^\@\@ \s+ - (\d+) # line of file 1 => $1 , (\d+) # count of file 1 => $2 \s* \+ (\d+) # line of file 2 => $3 , (\d+) # count of file 2 => $4 \s* \@\@/x
160 75 6 if ($state eq 'detail')
162 0 75 unless $ind =~ /[ +\-i\\]/
165 1 74 if $ind eq '\\'
168 64 10 if ($ind ne '+')
170 1 63 if ($lin < $#diff and $diff[$lin + 1] =~ /^\\/)
176 0 64 if $a_count < 0
181 56 18 if ($ind ne '-')
183 1 55 if ($lin < $#diff and $diff[$lin + 1] =~ /^\\/)
189 0 56 if $b_count < 0
194 10 2 unless ($a_count or $b_count)
216 18 28 if $proto{'chomp'}
220 11 35 if ($state eq 'patch')
221 1 10 unless /^(\d+) # start line of file 1 => $1 (?:,(\d+))? # end line of file 1 => $2 ([acd]) # Add, change, delete => $3 (\d+) # start line of file 2 => $4 (?:,(\d+))? # end line of file 2 => $5 /x
228 4 6 $2 ? :
230 2 8 $5 ? :
231 2 8 if $3 eq 'a'
232 2 8 if $3 eq 'd'
239 35 0 if ($state eq 'detail')
240 6 29 if /^---/
242 0 29 unless $ind =~ /[<>\\] /
246 18 11 if ($ind eq '< ')
248 1 17 if ($lin < $#diff and $diff[$lin + 1] =~ /^\\/)
254 0 18 if $a_count < 0
259 10 19 if ($ind eq '> ')
261 1 9 if ($lin < $#diff and $diff[$lin + 1] =~ /^\\/)
267 0 10 if $b_count < 0
272 10 9 unless ($a_count or $b_count)
293 0 0 if ref $VCS::Lite::Delta::error_action eq 'CODE'
294 0 0 if $VCS::Lite::Delta::error_action eq 'raise'
296 0 0 unless $VCS::Lite::Delta::error_action eq 'silent'
318 21 26 if ($typ eq '+') { }
322 1 20 if $short
328 1 25 if $short
334 3 14 if (not @del) { }
2 12 elsif (not @ins) { }
364 12 5 if @ins and @del
402 1 21 if grep {$$_[0] eq '-/';} @t1
405 1 21 if grep {$$_[0] eq '+/';} @t2
409 21 1 @t1 ? :
410 21 1 @t2 ? :
435 122 17 unless $ind eq 'c'
438 92 47 if $ind eq 'u'
441 42 5 unless $ind eq '+'
444 22 25 unless $ind eq '-'
451 0 6 wantarray ? :
457 0 1 if (@_)