File Coverage

blib/lib/DBR/Misc/Dummy.pm
Criterion Covered Total %
statement 9 15 60.0
branch 0 2 0.0
condition n/a
subroutine 5 11 45.4
pod 0 1 0.0
total 14 29 48.2


line stmt bran cond sub pod time code
1             # This program is free software; you can redistribute it and/or
2             # modify it under the terms of the GNU General Public License as
3             # published by the Free Software Foundation.
4              
5             package DBR::Misc::Dummy;
6             # I only ever evaluate to false... false false falsey false
7             # plus, when you call any method, I just return myself.
8              
9 18     18   106 use Carp;
  18         36  
  18         4552  
10             use overload
11             #values
12 4     4   66 '""' => sub { '' },
13 0     0   0 '0+' => sub { 0 },
14 33     33   783 'bool' => sub { 0 },
15              
16             #operators
17 0     0   0 '+' => sub { $_[1] },
18 0 0   0   0 '-' => sub { return $_[2] ? $_[1] : 0 - $_[1] },
19              
20 0     0   0 '*' => sub { 0 },
21 0     0   0 '/' => sub { 0 },
22              
23 18         452 'fallback' => 1
24 18     18   110 ;
  18         39  
25              
26 0     0 0 0 sub TO_JSON { undef }
27              
28             our $AUTOLOAD;
29 10     10   587 sub AUTOLOAD { shift }
30             1;