File Coverage

blib/lib/Rope/Handles/Counter.pm
Criterion Covered Total %
statement 15 15 100.0
branch 4 4 100.0
condition n/a
subroutine 7 7 100.0
pod 4 5 80.0
total 30 31 96.7


line stmt bran cond sub pod time code
1             package Rope::Handles::Counter;
2              
3 2     2   83841 use strict;
  2         3  
  2         59  
4 2     2   10 use warnings;
  2         2  
  2         363  
5              
6             sub new {
7 4     4 0 125292 my ($class, $str) = @_;
8 4         14 bless \$str, __PACKAGE__;
9             }
10              
11 22 100   22 1 9926 sub increment { ${$_[0]} += ($_[1] ? $_[1] : 1) }
  22         86  
12            
13 21 100   21 1 9644 sub decrement { ${$_[0]} -= ($_[1] ? $_[1] : 1) }
  21         99  
14            
15 2     2 1 6 sub reset { ${$_[0]} = 0 }
  2         9  
16              
17 1     1 1 4 sub clear { $_[0]->reset }
18              
19             1;
20              
21             __END__