Branch Coverage

blib/lib/Game/TextMapper/Gridmapper.pm
Criterion Covered Total %
branch 103 272 37.8


line true false branch
111 1 0 unless $caves
112 1 0 unless $caves
113 0 1 if $caves
115 1 0 if $pillars
116 0 1 if $caves
126 5 0 if ($r < 0.9) { }
0 0 elsif ($r < 0.95 and $pillars or $caves) { }
167 0 0 rand() < 0.5 ? :
188 0 0 if ($type eq '|' and $x == $start[0] || $x == $start[0] + $dimensions[0] - 1 or $type eq '-' and $y == $start[1] || $y == $start[1] + $dimensions[1] - 1) { }
501 1 0 if ($r < 0.2) { }
0 0 elsif ($r < 0.4) { }
0 0 elsif ($r < 0.6) { }
0 0 elsif ($r < 0.8) { }
552 0 1 if $n < @$result
553 1 0 if ($shift->[0] == $cols - 1) { }
578 0 0 if @{$result->[$first];} == 2
591 0 0 if $start == $end
592 0 0 if $result->[$end][0] != $x
594 0 0 if $min_up and $d > $min_up
595 0 0 if (not $min_up or $d < $min_up) { }
607 0 0 if $start == $end
608 0 0 if $result->[$end][1] != $y
610 0 0 if $min_left and $d > $min_left
611 0 0 if (not $min_left or $d < $min_left) { }
622 0 0 unless $_
625 0 0 if (@{$result->[$start];} == 3 and $result->[$start][2] == $start) { }
669 0 1 if $rest
671 0 1 $_ == 7 ? :
676 0 1 if (@$stairs > 2)
681 0 1 if $log->level eq "debug"
683 0 1 unless @$shape
699 0 0 $_ ? :
738 0 4 if (@$to == 3 and $to->[0] == $$shapes[$to->[2]][0] and $to->[1] == $$shapes[$to->[2]][1]) { }
3 1 elsif (@$to == 2) { }
761 0 1 if $log->level eq "debug"
773 1 3 if ($to->[0] < $from->[0]) { }
1 2 elsif ($to->[0] > $from->[0]) { }
0 2 elsif ($to->[1] < $from->[1]) { }
2 0 elsif ($to->[1] > $from->[1]) { }
831 22 10 if ($contact) { }
837 9 23 if $started and not $tiles->[$from]
838 0 32 if $n++ > 20
864 5 13 if ($tiles->[$here] and not $self->something($tiles, $here, $test{$dir}[0]) and not $self->something($tiles, $here, $test{$dir}[1]) and $self->something($tiles, $here, $test{$dir}[2]) and $self->something($tiles, $here, $test{$dir}[3]) and $self->something($tiles, $here, $test{$dir}[4]) || $self->something($tiles, $here, $test{$dir}[5]) and not $self->doors_nearby($here, \@doors))
872 0 5 unless $tiles->[$here][0] eq "empty"
877 1 4 if ($dir eq 's') { }
1 3 elsif ($dir eq 'e') { }
892 3 16 if $self->distance($door, $here) < 2
915 48 13 unless $tiles->[$i]
917 1 12 if grep {$_ eq qq["$room"];} @{$$tiles[$i];}
943 59 177 if $tiles->[$here]
945 33 144 if $distance <= 4
958 5 127 if ($self->empty($tiles, $here, $first) and &none(sub { $self->something($tiles, $here, $_); } , @test))
963 3 2 if ($distance < $stair_distance)
972 1 0 if (defined $stair)
978 0 0 unless $tiles->[$here]
979 0 0 if ($self->distance($here, $start) < 3 and @{$tiles->[$here];} == 1 and $tiles->[$here][0] eq "empty" and not grep({/-n$/u;} @{$$tiles[$here + $self->row];}) and not grep({/-w$/u;} @{$$tiles[$here + 1];}))
1009 0 0 unless $tiles->[$i]
1011 0 0 if grep {$_ eq qq["$room"];} @{$$tiles[$i];}
1014 0 0 if (grep {$_ eq "empty";} @{$$tiles[$start + $delta{$_}];})
1029 0 70 if (/^(arc|diagonal)-(ne|nw|se|sw)$/u)
1032 0 0 if (substr($dir, 0, 1) eq "n" and $here + $self->row < $self->max_tiles and $$tiles[$here + $self->row] and @{$$tiles[$here + $self->row];} or substr($dir, 0, 1) eq "s" and $here > $self->row and $$tiles[$here - $self->row] and @{$$tiles[$here - $self->row];} or substr($dir, 1) eq "e" and $here > 0 and $$tiles[$here - 1] and @{$$tiles[$here - 1];} or substr($dir, 1) eq "w" and $here < $self->max_tiles and $$tiles[$here + 1] and @{$$tiles[$here + 1];})
1057 0 70 if ($_ eq "pillar")
1061 0 0 if ($self->something($tiles, $here, $test{$dir}[0]) and not $self->something($tiles, $here, $test{$dir}[1]) and not $self->something($tiles, $here, $test{$dir}[2]))
1108 0 0 unless grep {$_ eq "empty";} @{$$tiles[$here];}
1109 0 0 if (not $_) { }
1110 0 0 if &all(sub { grep {$_;} $self->something($tiles, $here, $_); } , "n", "e", "w", "s")
1120 0 0 if (list_equal($expected, \@actual))
1134 0 0 if @$a1 ne @$a2
1136 0 0 unless $a1->[$i] eq $a2->[$i]
1152 6 697 if $here + $delta < 0 or $here + $delta > $self->max_tiles
1153 1 696 if $here % $self->row == 0 and $delta == -1
1154 0 696 if $here % $self->row == $self->row and $delta == 1
1165 1 570 unless $self->legal($here, $delta)
1166 368 202 if $$tiles[$here + $delta]
1175 6 126 unless $self->legal($here, $delta)
1184 0 0 if ($here > $self->row and $$tiles[$here - $self->row] and @{$$tiles[$here - $self->row];})
1187 0 0 if ($here + $self->row <= $self->max_tiles and $$tiles[$here + $self->row] and @{$$tiles[$here + $self->row];})
1190 0 0 if ($here > 0 and $$tiles[$here - 1] and @{$$tiles[$here - 1];})
1193 0 0 if ($here < $self->max_tiles and $$tiles[$here + 1] and @{$$tiles[$here + 1];})
1210 236 30 if ($tile)
1231 206 60 if (not $tile or @$tile == 0)
1233 0 206 if ($pen eq 'down' and $next and @$next) { }
1240 19 41 if ($pen eq "up")
1247 59 11 if ($_ eq 'empty') { }
0 11 elsif ($_ eq 'pillar') { }
5 6 elsif (/^"(\d+)"$/u) { }
0 6 elsif ($_ eq 'arc-se') { }
0 6 elsif ($_ eq 'arc-sw') { }
0 6 elsif ($_ eq 'arc-nw') { }
0 6 elsif ($_ eq 'arc-ne') { }
0 6 elsif ($_ eq 'diagonal-se') { }
0 6 elsif ($_ eq 'diagonal-sw') { }
0 6 elsif ($_ eq 'diagonal-nw') { }
0 6 elsif ($_ eq 'diagonal-ne') { }
0 6 elsif ($_ eq 'door-w') { }
3 3 elsif ($_ eq 'door-n') { }
0 3 elsif ($_ eq 'door-e') { }
0 3 elsif ($_ eq 'door-s') { }
2 1 elsif ($_ eq 'secret-w') { }
0 1 elsif ($_ eq 'secret-n') { }
0 1 elsif ($_ eq 'secret-e') { }
0 1 elsif ($_ eq 'secret-s') { }
0 1 elsif ($_ eq 'concealed-w') { }
0 1 elsif ($_ eq 'concealed-n') { }
0 1 elsif ($_ eq 'concealed-e') { }
0 1 elsif ($_ eq 'concealed-s') { }
0 1 elsif ($_ eq 'archway-w') { }
0 1 elsif ($_ eq 'archway-n') { }
0 1 elsif ($_ eq 'archway-e') { }
0 1 elsif ($_ eq 'archway-s') { }
1 0 elsif ($_ eq 'stair-s') { }
0 0 elsif ($_ eq 'stair-w') { }
0 0 elsif ($_ eq 'stair-n') { }
0 0 elsif ($_ eq 'stair-e') { }
0 0 elsif ($_ eq 'stair-spiral') { }
0 0 elsif ($_ eq 'rock') { }
0 0 elsif ($_ eq 'rock-n') { }
0 0 elsif ($_ eq 'rock-ne') { }
0 0 elsif ($_ eq 'rock-ne-alternative') { }
0 0 elsif ($_ eq 'rock-e') { }
0 0 elsif ($_ eq 'rock-se') { }
0 0 elsif ($_ eq 'rock-se-alternative') { }
0 0 elsif ($_ eq 'rock-s') { }
0 0 elsif ($_ eq 'rock-sw') { }
0 0 elsif ($_ eq 'rock-sw-alternative') { }
0 0 elsif ($_ eq 'rock-w') { }
0 0 elsif ($_ eq 'rock-nw') { }
0 0 elsif ($_ eq 'rock-nw-alternative') { }
0 0 elsif ($_ eq 'rock-dead-end-n') { }
0 0 elsif ($_ eq 'rock-dead-end-e') { }
0 0 elsif ($_ eq 'rock-dead-end-s') { }
0 0 elsif ($_ eq 'rock-dead-end-w') { }
0 0 elsif ($_ eq 'rock-corridor-n') { }
0 0 elsif ($_ eq 'rock-corridor-s') { }
0 0 elsif ($_ eq 'rock-corridor-e') { }
0 0 elsif ($_ eq 'rock-corridor-w') { }