Branch Coverage

blib/lib/Text/Diff/Parser.pm
Criterion Covered Total %
branch 91 106 85.8


line true false branch
24 9 6 if (1 == @args) { }
25 6 3 if ('HASH' eq ref $args[0]) { }
30 2 1 if (ref $diff or not $diff =~ /\n/) { }
50 0 15 if $$parms{'Verbose'}
54 0 15 if exists $$parms{'TrustAtAt'}
56 10 5 if ($$parms{'File'}) { }
2 3 elsif ($$parms{'Diff'}) { }
77 4 30 if ($file)
80 88 84 unless $ch->filename1 eq $file or $ch->filename2 eq $file
86 27 7 if wantarray
111 215 206 if ($ch->type eq '')
116 68 138 if ($prev)
119 38 30 if ($prev->type ne $ch->type and $prev->filename1 eq $ch->filename1 and $prev->filename2 eq $ch->filename2 and $size == $ch->size)
124 36 2 if ($prev->type eq 'REMOVE' and $prev->line2 == $ch->line2 and $prev->line1 + $size == $ch->line1) { }
2 0 elsif ($prev->type eq 'ADD' and $prev->line2 + $size == $ch->line2 and $prev->line1 == $ch->line1) { }
158 1 24 if (ref $file) { }
165 0 24 unless $fh->open($file)
177 6 19 if $$self{'simplify'}
200 0 2 if $$self{'simplify'}
209 0 2368 if $$self{'verbose'}
213 2123 245 if ($$state{'unified'}) { }
24 221 elsif ($$state{'standard'}) { }
215 2092 31 if $$state{'unified'}
219 18 6 if $$state{'standard'}
224 6 252 if ($line =~ /^diff\s+($file)\s+($file)\s*$/) { }
8 244 elsif ($line =~ /^(\d+)(?:,\d+)?[acd](\d+)(?:,\d+)?$/) { }
41 203 elsif ($line =~ /^--- (.+?)\t(.+)$/ or $line =~ /^--- ([^\s]+)\s+(.+)$/ or $line =~ /^--- ([^\s]+)$/) { }
0 203 elsif ($line =~ /^\*\*\* (.+?)\t(.+)$/ or $line =~ /^\*\*\* ([^\s]+)\s+(.+)$/) { }
226 0 6 if $$self{'verbose'}
240 0 8 if $$self{'verbose'}
250 0 41 if $$self{'verbose'}
266 70 24 unless $$self{'strip'}
281 14 10 if ($line =~ /^([<>])(.+)$/)
287 4 6 if ($line =~ /^---$/)
288 0 4 if $$self{'verbose'}
302 12 2082 if ($line =~ /^\+\+\+ (.+?)\t(.+)$/ or $line =~ /^\+\+\+ ([^\s]+)\s+(.+)$/ or $line =~ /^\+\+\+ ([^\s]+)$/)
310 0 2082 unless $$change{'filename2'}
311 121 1961 if ($line =~ /^\@\@ -(\d+)(?:,(\d+))? [+](\d+)(?:,(\d+))? \@\@\s*(.+)?$/)
313 80 41 if (@{$$change{'lines'};})
323 0 1961 unless defined $$change{'line1'}
332 1929 32 if ($$self{'trustatat'} and $$change{'size1'} > $$self{'count1'} || $$change{'size2'} > $$self{'count2'})
337 3 1958 if ($done and $line =~ /^---/)
342 1930 28 if ($line =~ /^([-+ ])(.*)?$/)
391 1042 902 if $mod ne 'ADD'
392 1768 176 if $mod ne 'REMOVE'
394 0 1944 if $$self{'verbose'}
396 1895 49 if (defined $$change{'type'}) { }
397 500 1395 if ($$change{'type'} ne $mod)
398 0 500 if $$self{'verbose'}
406 1042 902 unless $mod eq 'ADD'
407 1768 176 unless $mod eq 'REMOVE'
427 210 246 if $$self{'type'} eq 'ADD' or $$self{'type'} eq 'REMOVE' or $$self{'type'} eq 'MODIFY'
436 1 1 if 1 == @_