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 18     18   544430 use parent 'Panda::Export';
  18         39  
  18         85  
3 18     18   1039 use 5.012;
  18         55  
4 18     18   73 use Panda::Time;
  18         35  
  18         458  
5 18     18   5351 use Panda::Date::Rel;
  18         47  
  18         419  
6 18     18   5130 use Panda::Date::Int;
  18         42  
  18         2551  
7              
8             our $VERSION = '3.0.7';
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 18     18   107 fallback => 1;
  18         32  
  18         142  
37              
38             1;