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             DIE_WITH_STACK => sub {
30 0           for (my $i = 0; ; $i++) {
31 0           my ($package, $filename, $line, $subroutine) = caller($i);
32 0 0         die "\n" unless defined $package;
33 0           $filename =~ s/.*\///;
34 0   0       $subroutine = (caller($i+1))[3] || "(main)";
35 0           print "\t$filename, line $line, $subroutine\n";
36             }
37             },
38 1     1   5 };
  1         1  
  1         15  
39              
40             1;