Branch Coverage

blib/lib/Games/Cards/Poker.pm
Criterion Covered Total %
branch 144 292 49.3


line true false branch
33 0 1 unless @_
34 0 1 if ref $_[0] eq 'ARRAY'
36 0 1 if ($aflg) { }
41 46 5 if ($rand != $indx)
43 0 1 if ($aflg) { }
46 0 568589 unless @_
47 568589 0 if ref $_[0] eq 'ARRAY'
48 568589 0 if ($aflg) { }
64 526643 4274019 if ($suba eq 'A' and $subb ne 'A') { }
164396 4109623 elsif ($suba ne 'A' and $subb eq 'A') { }
538146 3571477 elsif ($suba eq 'K' and $subb ne 'K') { }
251727 3319750 elsif ($suba ne 'K' and $subb eq 'K') { }
233195 3086555 elsif ($suba eq 'Q' and $subb ne 'Q') { }
171066 2915489 elsif ($suba ne 'Q' and $subb eq 'Q') { }
276481 2639008 elsif ($suba eq 'J' and $subb ne 'J') { }
366894 2272114 elsif ($suba ne 'J' and $subb eq 'J') { }
173624 2098490 elsif ($suba eq 'T' and $subb ne 'T') { }
125385 1973105 elsif ($suba ne 'T' and $subb eq 'T') { }
7 1973098 elsif ($suba eq $subb) { }
75 0 7 if (length $a > $indx) { }
7 0 elsif (length $b > $indx) { }
80 568589 0 if ($aflg) { }
83 0 568582 unless @_
84 568569 13 if ref $_[0] eq 'ARRAY'
86 568569 13 if ($aflg) { }
88 568582 0 unless defined $aref and @{$aref;} == 1
89 2842991 0 if (defined $cndx and defined $aref->[$cndx])
90 562788 722487 if $suit and length $aref->[$cndx] < 2 || substr($aref->[$cndx], 1, 1) ne substr($aref->[0], 1, 1)
92 5794 562788 if ($suit)
94 0 18257 unless @crdz >= 5
99 534660 0 if defined $crdz[$choi->[$cndx]]
100 443375 91285 if @bhnd == 5
101 106932 427728 if @hand == 5
102 25247 81685 if (@hand == 5 and !@best || defined $bhsi && defined $rhsi && $bhsi > $rhsi)
109 18250 6 if (@crdz <= 2)
112 0 18256 unless @best == 5 and @crdz >= 5
143 0 7479 if not defined $hndx or $hndx =~ /\D/ or $hndx > $#{$pd8a{'hndz'};}
146 0 619932 unless @hand == 1 or @hand == 5
147 2 619930 if ref $hand[0] eq 'ARRAY'
148 2 619930 if ($aflg) { }
150 51370 568562 if (@{$aref;} == 1) { }
152 0 619932 unless defined $shrt and exists $zdnh{$shrt}
155 0 0 unless @hand
156 0 0 if ref $hand[0] eq 'ARRAY'
157 0 0 if ($aflg) { }
159 0 0 unless @{$aref;} == 1
160 0 0 if (@{$aref;} == 1) { }
163 0 0 if $shrt =~ /^A[KQJT]$/
166 0 0 unless @hand
167 0 0 if ref $hand[0] eq 'ARRAY'
168 0 0 if ($aflg) { }
170 0 0 if (@{$aref;} == 1) { }
174 0 0 if (/^\d$/) { }
0 0 elsif (/^[KQJT]$/) { }
0 0 elsif (/^A$/) { }
176 0 0 if $scor > 21
180 0 0 unless $scr0 =~ /^\d+$/ and $scr1 =~ /^\d+$/
181 0 0 if $scr0 == $scr1 or $scr0 > 21 and $scr1 > 21
182 0 0 if $scr0 > 21 or $scr1 <= 21 and $scr1 > $scr0
187 3 7 if (length $card == 1) { }
188 1 2 if ($card =~ /^[shdc]$/i) { }
192 9 1 if (exists $data{'rank'})
194 7 2 if exists $data{'suit'}
195 8 2 if (exists $data{'suit'})
196 8 24 if /^$data{'suit'}/i
202 8 58 if ($name =~ s/$pd8a{'rnam'}[$indx]//i)
204 8 17 if ($name =~ s/$_//i)
213 0 12 if (length $card == 1)
214 0 0 if ($card =~ /^[shdc]$/i) { }
217 12 151 if $card eq $deck[$indx]
222 0 36425 unless @hand == 1 or @hand == 5
223 2 36423 if ref $hand[0] eq 'ARRAY'
224 2 36423 if ($aflg) { }
226 36421 4 if (@{$aref;} == 1) { }
228 4 36421 if (defined $shrt and length $shrt < 5 and $shrt =~ /^\d+$/) { }
230 36425 92967 if defined $scor and $scor >= $_
234 0 0 unless @hand == 1 or @hand == 5
235 0 0 if ref $hand[0] eq 'ARRAY'
236 0 0 if ($aflg) { }
238 0 0 if (@{$aref;} == 1) { }
240 0 0 if (defined $shrt and length $shrt < 5 and $shrt =~ /^\d+$/) { }
242 0 0 if defined $shrt
243 0 0 if ($hnam =~ /^(High Card|Flush)$/) { }
0 0 elsif ($hnam eq 'One Pair') { }
0 0 elsif ($hnam eq 'Two Pair') { }
0 0 elsif ($hnam eq 'Three-of-a-Kind') { }
0 0 elsif ($hnam =~ /(^Straight|Flush$)/) { }
0 0 elsif ($hnam eq 'Full House') { }
0 0 elsif ($hnam eq 'Four-of-a-Kind') { }
248 0 0 if ($crdz[$_ - 1] eq $crdz[$_])
250 0 0 if ($_ == 1) { }
256 0 0 if ($crdz[$_ - 1] eq $crdz[$_])
257 0 0 if (defined $set0) { }
259 0 0 if ($_ == 3) { }
0 0 elsif ($ndx0 == 1) { }
268 0 0 if ($crdz[$_ - 1] eq $crdz[$_] and $crdz[$_ + 1] eq $crdz[$_])
271 0 0 if ($_ == 1) { }
276 0 0 if ($crdz[0] eq 'A' and $crdz[1] eq '5') { }
284 0 0 if ($crdz[1] eq $crdz[2]) { }
292 0 0 if ($crdz[0] eq $crdz[1]) { }
299 0 3 unless @hand >= 1
300 1 2 if ref $hand[0] eq 'ARRAY'
301 1 2 if ($aflg) { }
310 0 0 unless @hand >= 1
311 0 0 if ref $hand[0] eq 'ARRAY'
312 0 0 if ($aflg) { }
317 0 0 unless @dech >= 1
318 0 0 if ref $dech[0] eq 'ARRAY'
319 0 0 if ($aflg) { }
324 0 3 unless @_
326 0 3 if length $card == 1
327 0 3 if $card =~ / of /
328 3 0 if ref $_[0] eq 'ARRAY'
330 3 0 if ($aflg) { }
334 3 3 if ($aref->[$indx] eq $card)
337 3 0 if ($aflg) { }
340 5 9 if @crdz >= 5
341 0 9 if ref $crdz[0] eq 'ARRAY'
342 0 9 if ($aflg) { }
5 4 elsif (@crdz > 1) { }
349 7836 3017 if ($csrz[$cndx] eq $csrz[$wndx]) { }
350 17737 3969 unless /$csrz[$cndx] {$mwid}/x
351 9 10844 if $mflg
353 1 7471 unless defined $blim and $blim < 7462
354 10 7462 unless defined $glim and $glim < 7462
355 0 7472 if ($scop ne 'hndz' and $blim > $#{$pd8a{$scop};})
357 0 0 if (/^(.)\1 $/x) { }
0 0 elsif (/^..s$/) { }
0 36414 if ($scop eq 'holz') { }
0 36414 elsif ($scop eq 'flpz') { }
358 0 0 if (/^(.)\1\1$/) { }
0 0 elsif (/(.)\1/) { }
0 0 elsif (/^...s$/) { }
360 9032 27382 if ($name =~ /Flush/) { }
1108 26274 elsif (/(.)\1\1\1/) { }
1092 25182 elsif ($name =~ /^Full/) { }
61 25121 elsif ($name =~ /Straight/) { }
4291 20830 elsif ($name =~ /^Three/) { }
4290 16540 elsif ($name =~ /^Two/) { }
11441 5099 elsif ($name =~ /^One/) { }
370 0 0 unless defined $hole and $hole < $pd8a{'coun'}{'shorthand_holes'}
372 0 0 unless defined $flop and $flop < $pd8a{'coun'}{'shorthand_flops'}
373 0 0 unless defined $turn and $turn < 13
375 0 0 unless defined $rivr and $rivr < 13
393 0 16 unless defined $bord and length $bord >= 3
398 173 18069 if ($scor <= $losc)