File Coverage

blib/arch/Panda/Date.pm
Criterion Covered Total %
statement 17 18 94.4
branch n/a
condition n/a
subroutine 6 7 85.7
pod n/a
total 23 25 92.0


line stmt bran cond sub pod time code
1             package Panda::Date;
2 20     20   1612161 use parent 'Panda::Export';
  20         351  
  20         126  
3 20     20   1604 use 5.012;
  20         80  
4 20     20   114 use Panda::Time;
  20         55  
  20         610  
5 20     20   5358 use Panda::Date::Rel;
  20         58  
  20         624  
6 20     20   5786 use Panda::Date::Int;
  20         56  
  20         3774  
7              
8             our $VERSION = '3.1.0';
9              
10             require Panda::XSLoader;
11             Panda::XSLoader::bootstrap('Panda::Date', $VERSION);
12              
13             Panda::Export->import(
14             E_OK => 0,
15             E_UNPARSABLE => 1,
16             E_RANGE => 2,
17             SEC => rdate_const("1s"),
18             MIN => rdate_const("1m"),
19             HOUR => rdate_const("1h"),
20             DAY => rdate_const("1D"),
21             MONTH => rdate_const("1M"),
22             YEAR => rdate_const("1Y"),
23             );
24              
25             use overload
26             '""' => \&to_string,
27             'bool' => \&to_bool,
28             '0+' => \&to_number,
29             '<=>' => \&compare,
30             'cmp' => \&compare,
31             '+' => \&add_new,
32             '+=' => \&add,
33             '-' => \&subtract_new,
34             '-=' => \&subtract,
35 0     0     '=' => sub { $_[0] },
36 20     20   165 fallback => 1;
  20         42  
  20         347  
37              
38             1;