Branch Coverage

blib/lib/Game/TextPatterns.pm
Criterion Covered Total %
branch 84 108 77.7


line true false branch
46 1 93 unless exists $param->{'pattern'}
55 0 22 unless defined $pattern
57 2 20 if (ref $fill eq 'ARRAY') { }
65 1 21 if ($cur_dim[1] > $new_dim[1]) { }
2 19 elsif ($cur_dim[1] < $new_dim[1]) { }
83 0 12 unless defined $pattern
85 2 10 if (ref $fill eq 'ARRAY') { }
94 1 11 if ($cur_dim[0] > $new_dim[0]) { }
1 10 elsif ($cur_dim[0] < $new_dim[0]) { }
118 1 1 if (defined $width) { }
119 0 1 if not &looks_like_number($width) or $width < 1
126 1 1 if (defined $char and length $char) { }
152 9 37 if $p->[0] < 0
153 9 37 if $p->[1] < 0
154 0 45 if ($p->[0] < 0 or $p->[0] >= $cols or $p->[1] < 0 or $p->[1] >= $rows)
159 1 21 if $p1->[0] > $p2->[0]
160 0 22 if $p1->[1] > $p2->[1]
168 0 17 unless ($p2)
173 1 16 unless defined $p1
175 15 1 unless ($p2->[0] == 0 or $p2->[1] == 0)
188 5 1 unless (defined $pattern)
190 0 5 unless defined $pattern
210 0 2 if ($p->[0] < 0 or $p->[0] > $max_col or $p->[1] < 0 or $p->[1] > $max_row)
219 10 28 if ($$ref[$p->[1]][$p->[0]] eq $replace)
239 6 0 if @$pat > 1
256 2 3 if ($reduce_col)
261 2 3 if ($reduce_row)
274 11 0 if @$pat > 1
280 4 0 if (defined $fill) { }
281 0 4 if ref $fill
288 2 2 if ($do_crop) { }
290 1 1 if ($cols > $rows) { }
1 0 elsif ($cols < $rows) { }
297 1 1 if ($cols > $rows) { }
1 0 elsif ($cols < $rows) { }
333 0 4 unless substr $rep->[$r], $-[0], $+[0] - $-[0]
340 0 6 if not defined $cols && &looks_like_number($cols) or $cols < 1
345 4 2 if (defined $rows) { }
346 0 4 if not &looks_like_number($rows) or $rows < 1
353 4 2 if ($cols > 1)
358 4 2 if ($rows > 1)
367 0 4 if $p->[0] < 0
368 0 4 if $p->[1] < 0
369 0 3 if ($p->[0] < 0 or $p->[0] >= $cols or $p->[1] < 0 or $p->[1] >= $rows)
390 2 0 if ($to_fill > 0)
393 4 12 if (substr($row, $c, 1) =~ /$re/u and rand() < $to_fill / $total)
409 2 17 if ($rotate_by == 0) { }
5 12 elsif ($rotate_by == 2) { }
417 6 6 if ($rotate_by == 1) { }
6 0 elsif ($rotate_by == 3) { }
421 6 0 if ($rows > 1)
432 6 0 if ($rows > 1)
463 2 1 if ($to_fill > 0)
466 15 5 if (rand() < $to_fill / $total)