Branch Coverage

blib/lib/Chess/PGN/Parse.pm
Criterion Covered Total %
branch 58 226 25.6


line true false branch
222 3 1 if (defined $filename) { }
293 0 0 unless $item =~ /\$?(\d+)/x
294 0 0 if $1 > 139 or $1 < 0
295 0 0 unless (scalar keys %numeric_annotation_glyph)
300 0 0 if ($1 > 0 and $1 <= 6)
303 0 0 if ($item =~ /^\$/x) { }
499 0 0 if @_
505 0 0 if @_
511 0 0 if @_
517 0 0 if @_
523 0 0 if @_
529 0 0 if @_
535 0 0 if @_
541 0 0 if @_
547 0 0 if @_
553 0 0 if @_
559 0 0 if @_
565 0 0 if @_ and ref $_[0] eq 'ARRAY'
590 0 25 if exists $self->{'gamedescr'}{'FirstMove'}
715 0 22 unless $memory->{'game'}
716 0 22 unless $memory->{'tag_printed'}
727 0 246 if ($memory->{'game'})
730 2 244 if $memory->{'utag'}
731 0 244 if ($memory->{'tag'} =~ tr/]// > 1)
749 0 25 if $memory->{'tag'}
750 0 25 if $memory->{'game'}
753 0 434 if (/^;/)
754 0 0 if ($memory->{'game_printed'} or not $memory->{'game'}) { }
0 0 elsif ($memory->{'game'}) { }
765 43 391 if (/^\s*$/)
766 21 22 if ($memory->{'game'})
768 0 21 if ($memory->{'game'} =~ tr/{// < $memory->{'game'} =~ tr/}//)
776 0 391 if ($memory->{'utag'}) { }
245 146 elsif (/^\[/ and not $memory->{'game'}) { }
781 0 0 if ($left_brackets == $right_brackets)
790 244 1 if ($left_brackets == $right_brackets) { }
0 1 elsif ($right_brackets > $left_brackets) { }
807 245 146 if ($memory->{'tag'})
808 0 245 if $memory->{'game'}
812 1 3 if ($memory->{'tag'})
815 1 3 if ($memory->{'game'})
845 0 0 unless defined $_
847 0 0 if /^\s*$/
848 0 0 unless $block
849 0 0 unless /\[(\w+)/
851 0 0 unless /\"(.*)\"/
857 0 0 unless defined $_
859 0 0 unless defined $_
860 0 0 if /^\s*$/
861 0 0 unless $block
883 0 0 if (exists $params->{'all_tags'} and $params->{'all_tags'} =~ /^(?:[Yy][Ee][Ss]|1)$/) { }
0 0 elsif (exists $params->{'tags'}) { }
891 0 0 unless $seen{$_}
911 0 0 if (defined $pattern)
912 0 0 if (length $pattern == 1) { }
0 0 elsif (length $pattern == 2) { }
0 0 elsif ($pattern =~ /^(.*)\|(.*)$/) { }
1005 0 0 if exists $params->{'game'} and lc $params->{'game'} ne 'yes'
1010 0 0 if $out_game and (exists $params->{'comments'} and lc $params->{'comments'} eq 'yes')
1012 0 0 if exists $params->{'nl'}
1015 0 0 unless exists $self->{'gamedescr'}{$_}
1020 0 0 if (@tags)
1023 0 0 unless $out_game
1024 0 0 if (defined $self->{'GameMoves'}) { }
1027 0 0 if (defined $self->{'gamedescr'}{'FirstMove'} and $self->{'gamedescr'}{'FirstMove'} =~ /(\d+)([bw])/)
1032 0 0 if $color eq 'b'
1036 0 0 if ($color eq 'w') { }
1038 0 0 if $len and $count > 1
1048 0 0 if ($out_comments and exists $self->comments->{$count - 1 . "$color"})
1055 0 0 if ($len >= 75)
1061 0 0 if $delta < 0
1069 0 0 if $needs_nl
1073 0 0 if ($len >= 75)
1096 0 0 if ($self->{'gamedescr'}{'Game'} =~ /\(/) { }
1173 0 20 if $self->{'gamedescr'}{'Game'} =~ /\(/
1176 0 20 if $self->{'gamedescr'}{'Game'} =~ /\{/
1185 0 20 if (exists $params->{'check_moves'} and $params->{'check_moves'} =~ /^(?:yes|1)$/)
1190 0 20 unless $self->{'gamedescr'}{'Game'}
1258 1 0 if my $log_errors = exists $params->{'log_errors'}
1259 0 1 unless $self->{'gamedescr'}{'Game'}
1269 0 1 if $save_comments and exists $params->{'comments_struct'}
1270 1 0 unless $comments_struct =~ /^(?:array|hol)$/
1276 0 1 unless ($self->{'gamedescr'}{'Game'} =~ /\d\./)
1285 22 70 if (/\G($re_number)\s*/cgm) { }
37 33 elsif (/\G($re_any_move)\s*/cgm) { }
9 24 elsif (/\G($re_comment |$re_eol_comment |$re_rav |$re_nag|$re_escape)\s*/cgmx) { }
24 0 elsif (/\G(\S+\s*)/cgm) { }
1287 3 19 if ($num =~ tr/.//d > 1)
1290 1 21 if ($movecount == 0) { }
18 3 elsif ($movecount == $num - 1) { }
0 3 elsif ($movecount != $num) { }
1294 0 1 unless $num . $switchcolor{$color} eq '1w'
1308 0 37 if ($countless)
1310 0 0 if ($plycount == 2)
1323 9 0 if ($save_comments)
1329 9 0 if ($comments_struct eq 'string') { }
0 0 elsif ($comments_struct eq 'array') { }
1341 0 0 if $1 and exists $comment_types{$1}
1348 24 0 if ($log_errors)
1378 0 0 unless $comment_struct and $comment_struct =~ /^hol|array$/
1380 0 0 if ($self->moves and $comments and ref $comments eq 'HASH')
1382 0 0 unless /^\d+(?:w|b)$/
1383 0 0 if ($comment_struct eq 'string') { }
0 0 elsif ($comment_struct eq 'array') { }
1395 0 0 if $1 and exists $comment_types{$1}
1500 0 0 if $1 eq '/'
1502 0 0 if ($piece < 15) { }
1531 0 0 if ($piece == 15)
1536 0 0 if ($piece =~ /[1-8]/) { }
1542 0 0 if ($rowsum == 8)
1545 0 0 if $overall_sum >= 64
1553 0 0 if ($ep ne '-')
1554 0 0 $color eq 'w' ? :