Branch Coverage

blib/lib/Game/Life/Infinite/Board.pm
Criterion Covered Total %
branch 185 270 68.5


line true false branch
42 1 41 ref $rulesRef eq 'ARRAY' ? :
43 30 12 if ($$self{'color'} > 0)
47 42 0 ref $breedRef eq 'ARRAY' ? :
48 42 0 ref $liveRef eq 'ARRAY' ? :
54 30 0 defined $color ? :
55 0 30 if ($$self{'gen'} > 0)
56 13 17 if (lc $color eq 'immigration') { }
17 0 elsif (lc $color eq 'quadlife') { }
0 0 elsif (lc $color eq 'normal') { }
82 256 19253 unless defined $$self{'cells'}{join $;, $xpos, $ypos}
83 9042 10467 if ($$self{'cells'}{join $;, $xpos, $ypos}{'state'} and not $state)
89 9042 72336 if ($xx == $xpos and $yy == $ypos)
92 72336 0 if (defined $$self{'cells'}{join $;, $xx, $yy}) { }
101 10456 9053 if (not $$self{'cells'}{join $;, $xpos, $ypos}{'state'} and $state)
103 0 10456 if ($state > 1 and $$self{'color'} < 1 or $state > 2 and $$self{'color'} < 2 or $state > 4 or $state < 0)
116 10456 83648 if ($xx == $xpos and $yy == $ypos)
119 73211 10437 if (defined $$self{'cells'}{join $;, $xx, $yy}) { }
137 0 0 if (defined $$self{'cells'}{join $;, $xpos, $ypos}) { }
154 117 10576 if $$self{'maxx'} < $xpos
155 232 10461 if $$self{'minx'} > $xpos
156 599 10094 if $$self{'maxy'} < $ypos
157 27 10666 if $$self{'miny'} > $ypos
166 0 11 unless (defined $fn)
168 0 11 unless open my $fh, '<:crlf', $fn
173 0 11 unless (defined $ftype)
177 8 3 if ($$ftype{'format'} eq 'CELLS') { }
1 2 elsif ($$ftype{'format'} eq 'RLE') { }
1 1 elsif ($$ftype{'format'} eq 'Life' and $$ftype{'version'} eq '1.05') { }
1 0 elsif ($$ftype{'format'} eq 'Life' and $$ftype{'version'} eq '1.06') { }
193 0 11 if (not $loadok) { }
205 0 0 unless (defined $fn)
207 0 0 unless open $output, '>', $fn
210 0 0 if (defined $$self{'cells'}{join $;, $xx, $yy}) { }
211 0 0 if ($$self{'cells'}{join $;, $xx, $yy}{'state'} == 1) { }
0 0 elsif ($$self{'cells'}{join $;, $xx, $yy}{'state'} > 1) { }
238 0 0 if (defined $$self{'cells'}{join $;, $xx, $yy}) { }
239 0 0 if ($$self{'cells'}{join $;, $xx, $yy}{'state'} == 1) { }
0 0 elsif ($$self{'cells'}{join $;, $xx, $yy}{'state'} > 1) { }
274 0 9040 defined $error ? :
281 5361 3949 if ($$self{'cells'}{join $;, $$rec[0], $$rec[1]}{'neighbours'}{'total'} == 0)
287 1048 0 defined $$self{'usedCells'} && $$self{'usedCells'} > 0 ? :
288 207 841 if ($oscCheck > 1)
305 9042 79860 if ($$self{'cells'}{join $;, $xx, $yy}{'state'} > 0 and not $$self{'cells'}{join $;, $xx, $yy}{'neighbours'}{'total'} ~~ $$self{'liveRules'}) { }
9040 70820 elsif ($$self{'cells'}{join $;, $xx, $yy}{'state'} == 0 and $$self{'cells'}{join $;, $xx, $yy}{'neighbours'}{'total'} ~~ $$self{'breedRules'}) { }
9310 74269 elsif ($$self{'cells'}{join $;, $xx, $yy}{'state'} == 0 and $$self{'cells'}{join $;, $xx, $yy}{'neighbours'}{'total'} == 0) { }
316 8792 248 if ($$self{'color'} == 0) { }
326 992 248 if ($state ne 'total')
327 309 683 if ($$self{'cells'}{join $;, $xx, $yy}{'neighbours'}{$state} > 0)
333 57 191 if ($ccnt == 2) { }
2 189 elsif ($ccnt == 3) { }
189 0 elsif ($ccnt == 1) { }
338 114 114 if (defined $colorcounts[$i])
339 103 11 if ($colorcounts[$i] > $max)
348 2 4 unless (defined $colorcounts[$i])
356 189 282 if (defined $colorcounts[$i])
381 1048 0 defined $oscCheck ? :
382 3 1045 if ($oscCheck != $$self{'osccheck'})
400 219 43 if (defined $$self{'snapshots'}{$ogenString})
402 10 209 if ($$self{'snapshots'}{$ogenString}{'snapshot'} eq $$self{'snapshots'}{$lgenString}{'snapshot'} and $$self{'snapshots'}{$ogenString}{'minx'} == $$self{'snapshots'}{$lgenString}{'minx'} and $$self{'snapshots'}{$ogenString}{'maxx'} == $$self{'snapshots'}{$lgenString}{'maxx'} and $$self{'snapshots'}{$ogenString}{'miny'} == $$self{'snapshots'}{$lgenString}{'miny'} and $$self{'snapshots'}{$ogenString}{'maxy'} == $$self{'snapshots'}{$lgenString}{'maxy'}) { }
429 66796 196232 if (defined $$self{'cells'}{join $;, $xx, $yy}) { }
430 17392 49404 if ($$self{'cells'}{join $;, $xx, $yy}{'state'} == 1) { }
51 49353 elsif ($$self{'cells'}{join $;, $xx, $yy}{'state'} > 1) { }
459 68 456 if ($$self{'cells'}{join $;, $xx, $yy}{'state'} == 0 and $$self{'cells'}{join $;, $xx, $yy}{'neighbours'}{'total'} == 0) { }
463 449 7 if ($ok) { }
464 15 434 if ($xx > $$self{'maxx'})
465 14 435 if ($xx < $$self{'minx'})
466 12 437 if ($yy > $$self{'maxy'})
467 14 435 if ($yy < $$self{'miny'})
507 2 13 if ($line =~ /^#Life 1.05/ or $line =~ /^#Life 1.06/ or $line =~ /^#MCell/) { }
1 12 elsif ($line =~ /^(b|o|[[:digit:]])/) { }
8 4 elsif ($line =~ /^(\.|O|!)/) { }
0 4 elsif ($line =~ /^(\.|O|2|3|4|!)/) { }
529 0 1 unless (defined $array)
533 0 325 if ($input eq '')
534 1 324 if ($input =~ /^#Life 1.06/)
550 0 1 unless (defined $array)
560 1 202 if ($input eq '')
561 1 201 if ($input =~ /^#Life 1.05/) { }
1 200 elsif ($input =~ /^#D Name: /) { }
2 198 elsif ($input =~ /^#D /) { }
1 197 elsif ($input =~ /^#N/) { }
0 197 elsif ($input =~ /^#R /) { }
2 195 elsif ($input =~ /^#P /) { }
195 0 elsif ($input =~ /^(\.|\*)/ and $posState == 1) { }
568 0 2 if ($dlinecnt >= 22)
571 0 2 if (length $dline > 78) { }
588 0 0 if (substr($bstr, $i, 1) =~ /[0-8]/) { }
597 0 0 if (substr($sstr, $i, 1) =~ /[0-8]/) { }
622 324 3762 if ($char eq '*') { }
3762 0 elsif ($char eq '.') { }
651 0 1 unless (defined $array)
659 1 19 if ($input =~ /^#N /) { }
0 19 elsif ($input =~ /^#r /) { }
0 19 elsif ($input =~ /^#P / or $input =~ /^#R /) { }
2 17 elsif ($input =~ /^#/) { }
1 16 elsif ($input =~ /^x/) { }
677 0 1 unless ($xc =~ /x=/ and $yc =~ /y=/)
685 0 16 unless ($posState)
708 518 476 if ($char =~ /\d/) { }
200 276 elsif ($char eq 'o') { }
275 1 elsif ($char eq 'b') { }
1 0 elsif ($char eq '!') { }
712 124 76 $cntstr eq '0' ? :
718 19 256 $cntstr eq '0' ? :
727 0 0 $cntstr eq '0' ? :
728 0 0 if (defined $extraStates{$char}) { }
735 0 0 if ($extraStatesCnt > 3) { }
741 0 0 if ($extraStatesCnt == 1) { }
0 0 elsif ($extraStatesCnt > 1) { }
742 0 0 unless $self->setColor('immigration')
744 0 0 unless $self->setColor('quadlife')
753 76 4 $cntstr eq '0' ? :
759 0 1 if ($extraStatesCnt > 1) { }
0 1 elsif ($extraStatesCnt == 1) { }
760 0 0 unless $self->setColor('quadlife')
763 0 0 unless $self->setColor('immigration')
768 1 0 if ($rules ne '') { }
0 0 elsif ($headRules ne '') { }
775 1 0 if ($rules ne '' or $headRules ne '')
779 1 1 if (substr($bstr, $i, 1) =~ /\d/)
782 2 1 if (substr($sstr, $i, 1) =~ /\d/)
793 0 8 unless (defined $array)
803 1 157 if ($input =~ /^!Name: /) { }
2 155 elsif ($input =~ /^!/) { }
811 417 5418 if (substr($input, $yy, 1) eq 'O') { }
12 5406 elsif (substr($input, $yy, 1) eq '2') { }
9 5397 elsif (substr($input, $yy, 1) eq '3') { }
6 5391 elsif (substr($input, $yy, 1) eq '4') { }
815 0 12 unless $self->setColor('immigration')
820 0 9 unless $self->setColor('quadlife')
825 0 6 unless $self->setColor('quadlife')
836 2 6 if ($quadlife) { }
1 5 elsif ($immigration) { }
837 0 2 unless $self->setColor('quadlife')
839 0 1 unless $self->setColor('immigration')