File Coverage

lib/Games/Checkers/Constants.pm
Criterion Covered Total %
statement 3 9 33.3
branch 0 2 0.0
condition 0 2 0.0
subroutine 1 1 100.0
pod n/a
total 4 14 28.5


line stmt bran cond sub pod time code
1             # Games::Checkers, Copyright (C) 1996-2012 Mikhael Goikhman, migo@cpan.org
2             #
3             # This program is free software: you can redistribute it and/or modify
4             # it under the terms of the GNU General Public License as published by
5             # the Free Software Foundation, either version 3 of the License, or
6             # (at your option) any later version.
7             #
8             # This program is distributed in the hope that it will be useful,
9             # but WITHOUT ANY WARRANTY; without even the implied warranty of
10             # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11             # GNU General Public License for more details.
12             #
13             # You should have received a copy of the GNU General Public License
14             # along with this program. If not, see .
15              
16             package Games::Checkers::Constants;
17              
18             use Games::Checkers::DeclareConstant {
19             Ok => 0,
20             Err => 1,
21             No => 0,
22             Yes => 1,
23             False => 0,
24             True => 1,
25             White => 0,
26             Black => 1,
27             Pawn => 0,
28             King => 1,
29             NL => -2,
30             ML => -3,
31             MIN_SCORE => -1e9,
32             MAX_SCORE => +1e9,
33             DIE_WITH_STACK => sub {
34 0           for (my $i = 0; ; $i++) {
35 0           my ($package, $filename, $line, $subroutine) = caller($i);
36 0 0         die "\n" unless defined $package;
37 0           $filename =~ s/.*\///;
38 0   0       $subroutine = (caller($i+1))[3] || "(main)";
39 0           print "\t$filename, line $line, $subroutine\n";
40             }
41             },
42 1     1   312 };
  1         3  
  1         12  
43              
44             1;