Branch Coverage

blib/lib/Game/TextMapper/Gridmapper.pm
Criterion Covered Total %
branch 116 272 42.6


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 4 1 if ($r < 0.9) { }
0 1 elsif ($r < 0.95 and $pillars or $caves) { }
167 1 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 0 1 if ($r < 0.2) { }
0 1 elsif ($r < 0.4) { }
0 1 elsif ($r < 0.6) { }
1 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]) { }
4 0 elsif (@$to == 2) { }
761 0 1 if $log->level eq "debug"
773 2 2 if ($to->[0] < $from->[0]) { }
1 1 elsif ($to->[0] > $from->[0]) { }
0 1 elsif ($to->[1] < $from->[1]) { }
1 0 elsif ($to->[1] > $from->[1]) { }
831 22 10 if ($contact) { }
837 10 22 if $started and not $tiles->[$from]
838 0 32 if $n++ > 20
864 5 11 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') { }
3 1 elsif ($dir eq 'e') { }
892 3 16 if $self->distance($door, $here) < 2
915 71 20 unless $tiles->[$i]
917 1 19 if grep {$_ eq qq["$room"];} @{$$tiles[$i];}
943 57 164 if $tiles->[$here]
945 35 129 if $distance <= 4
958 11 129 if ($self->empty($tiles, $here, $first) and &none(sub { $self->something($tiles, $here, $_); } , @test))
963 2 9 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 4 64 if (/^(arc|diagonal)-(ne|nw|se|sw)$/u)
1032 0 2 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 68 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 651 if $here + $delta < 0 or $here + $delta > $self->max_tiles
1153 0 651 if $here % $self->row == 0 and $delta == -1
1154 0 651 if $here % $self->row == $self->row and $delta == 1
1165 0 517 unless $self->legal($here, $delta)
1166 347 170 if $$tiles[$here + $delta]
1175 6 134 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 221 45 if ($tile)
1231 208 58 if (not $tile or @$tile == 0)
1233 1 207 if ($pen eq 'down' and $next and @$next) { }
1240 13 45 if ($pen eq "up")
1247 53 15 if ($_ eq 'empty') { }
0 15 elsif ($_ eq 'pillar') { }
5 10 elsif (/^"(\d+)"$/u) { }
1 9 elsif ($_ eq 'arc-se') { }
1 8 elsif ($_ eq 'arc-sw') { }
1 7 elsif ($_ eq 'arc-nw') { }
1 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') { }
3 3 elsif ($_ eq 'door-w') { }
1 2 elsif ($_ eq 'door-n') { }
0 2 elsif ($_ eq 'door-e') { }
0 2 elsif ($_ eq 'door-s') { }
0 2 elsif ($_ eq 'secret-w') { }
0 2 elsif ($_ eq 'secret-n') { }
0 2 elsif ($_ eq 'secret-e') { }
0 2 elsif ($_ eq 'secret-s') { }
0 2 elsif ($_ eq 'concealed-w') { }
0 2 elsif ($_ eq 'concealed-n') { }
0 2 elsif ($_ eq 'concealed-e') { }
0 2 elsif ($_ eq 'concealed-s') { }
1 1 elsif ($_ eq 'archway-w') { }
0 1 elsif ($_ eq 'archway-n') { }
0 1 elsif ($_ eq 'archway-e') { }
0 1 elsif ($_ eq 'archway-s') { }
0 1 elsif ($_ eq 'stair-s') { }
0 1 elsif ($_ eq 'stair-w') { }
1 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') { }