File Coverage

blib/lib/Rope/Handles/Number.pm
Criterion Covered Total %
statement 32 32 100.0
branch 4 4 100.0
condition n/a
subroutine 12 12 100.0
pod 9 10 90.0
total 57 58 98.2


line stmt bran cond sub pod time code
1             package Rope::Handles::Number;
2              
3 2     2   164904 use strict;
  2         3  
  2         89  
4 2     2   14 use warnings;
  2         2  
  2         521  
5              
6             sub new {
7 5     5 0 265390 my ($class, $str) = @_;
8 5         20 bless \$str, __PACKAGE__;
9             }
10              
11 3     3 1 11 sub add { ${$_[0]} = ${$_[0]} + $_[1] }
  3         15  
  3         14  
12            
13 2     2 1 4 sub subtract { ${$_[0]} = ${$_[0]} - $_[1] }
  2         7  
  2         4  
14            
15 2     2 1 3 sub multiply { ${$_[0]} = ${$_[0]} * $_[1] }
  2         9  
  2         5  
16            
17 2     2 1 4 sub divide { ${$_[0]} = ${$_[0]} / $_[1] }
  2         9  
  2         6  
18            
19 1     1 1 1 sub modulus { ${$_[0]} = ${$_[0]} % $_[1] }
  1         4  
  1         3  
20            
21 2     2 1 6 sub absolute { ${$_[0]} = abs(${$_[0]}) }
  2         8  
  2         5  
22              
23 3 100   3 1 6 sub increment { ${$_[0]} += ($_[1] ? $_[1] : 1) }
  3         15  
24            
25 3 100   3 1 4 sub decrement { ${$_[0]} -= ($_[1] ? $_[1] : 1) }
  3         18  
26              
27 1     1 1 2 sub clear { ${$_[0]} = 0 }
  1         4  
28              
29             1;
30              
31             __END__