File Coverage

blib/lib/Rope/Handles/Counter.pm
Criterion Covered Total %
statement 12 15 80.0
branch 2 4 50.0
condition n/a
subroutine 5 7 71.4
pod 4 5 80.0
total 23 31 74.1


line stmt bran cond sub pod time code
1             package Rope::Handles::Counter;
2              
3 1     1   131075 use strict;
  1         3  
  1         89  
4 1     1   16 use warnings;
  1         3  
  1         264  
5              
6             sub new {
7 1     1 0 216456 my ($class, $str) = @_;
8 1         5 bless \$str, __PACKAGE__;
9             }
10              
11 20 50   20 1 15931 sub increment { ${$_[0]} += ($_[1] ? $_[1] : 1) }
  20         141  
12            
13 19 50   19 1 16787 sub decrement { ${$_[0]} -= ($_[1] ? $_[1] : 1) }
  19         105  
14            
15 0     0 1   sub reset { ${$_[0]} = 0 }
  0            
16              
17 0     0 1   sub clear { $_[0]->reset }
18              
19             1;
20              
21             __END__