Branch Coverage

blib/lib/Games/Tournament/Card.pm
Criterion Covered Total %
branch 43 66 65.1


line true false branch
14 24 3 @Games::Tournament::Swiss::Config::roles ? :
75 0 22 unless keys %roles == 2 or grep /bye/i, values %roles
81 2 40 if ($role eq 'Bye') { }
20 20 elsif (exists $result->{$role}) { }
20 0 elsif (values %$contestants != 1) { }
85 20 0 if ($result->{$role} =~ /^(?:Win|Loss|Draw|Forfeit)$/i) { }
99 20 0 if (exists $result->{$other}) { }
101 8 12 if $result->{$other} =~ /^Win$/i
103 12 8 if $result->{$other} =~ /^Loss$/i
105 0 20 if $result->{$other} =~ /^Draw$/i
155 22466 880 if exists $contestants->{$role}
157 440 11233 if exists $contestants->{'Bye'}
195 0 0 unless $contestant and $contestant->isa('Games::Tournament::Contestant::Swiss')
200 0 0 if @dupes
202 0 0 if $self->isBye
225 0 5621 unless ($self->hasPlayer($contestant))
232 0 11038 unless $contestant and $contestant->isa('Games::Tournament::Contestant::Swiss')
237 0 5621 if @dupes
246 0 5621 unless $role
310 0 19572 if (defined $contestants) { }
326 153 6210 if (defined $result) { }
343 0 3 unless &looks_like_number($score[0])
360 1 1 if $score[0] > $score[1]
361 1 0 if $score[0] < $score[1]
377 0 0 if (defined $floats) { }
393 0 1422 unless $player and $player->isa('Games::Tournament::Contestant::Swiss')
396 0 1362 unless $role eq 'Bye' or $role eq ('White', 'Black')[0] or $role eq ('White', 'Black')[1]
401 60 1362 if ($role eq 'Bye') { }
531 831 elsif (defined $float) { }
153 678 elsif ($self->{'floats'}{$role}) { }
419 8 32 if @status == 1 and &any(sub { $_ eq 'Bye'; } , @status)
420 32 32 unless $_ eq ('White', 'Black')[0]
32 0 if @status == 2 and &all(sub { $_ eq ('White', 'Black')[1] unless $_ eq ('White', 'Black')[0]; } , @status)