Branch Coverage

blib/lib/Game/TextPatterns.pm
Criterion Covered Total %
branch 78 100 78.0


line true false branch
46 1 90 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
213 6 0 if @$pat > 1
230 2 3 if ($reduce_col)
235 2 3 if ($reduce_row)
248 11 0 if @$pat > 1
254 4 0 if (defined $fill) { }
255 0 4 if ref $fill
262 2 2 if ($do_crop) { }
264 1 1 if ($cols > $rows) { }
1 0 elsif ($cols < $rows) { }
271 1 1 if ($cols > $rows) { }
1 0 elsif ($cols < $rows) { }
307 0 4 unless substr $rep->[$r], $-[0], $+[0] - $-[0]
314 0 6 if not defined $cols && &looks_like_number($cols) or $cols < 1
319 4 2 if (defined $rows) { }
320 0 4 if not &looks_like_number($rows) or $rows < 1
327 4 2 if ($cols > 1)
332 4 2 if ($rows > 1)
341 0 4 if $p->[0] < 0
342 0 4 if $p->[1] < 0
343 0 3 if ($p->[0] < 0 or $p->[0] >= $cols or $p->[1] < 0 or $p->[1] >= $rows)
359 2 17 if ($rotate_by == 0) { }
5 12 elsif ($rotate_by == 2) { }
367 6 6 if ($rotate_by == 1) { }
6 0 elsif ($rotate_by == 3) { }
371 6 0 if ($rows > 1)
382 6 0 if ($rows > 1)
413 2 1 if ($to_fill > 0)
416 15 5 if (rand() < $to_fill / $total)