File Coverage

blib/lib/Evo/Promise/Deferred.pm
Criterion Covered Total %
statement 17 17 100.0
branch 8 12 66.6
condition n/a
subroutine 3 3 100.0
pod 0 2 0.0
total 28 34 82.3


line stmt bran cond sub pod time code
1             package Evo::Promise::Deferred;
2 12     12   6075 use Evo '-Class *';
  12         77  
  12         82  
3              
4             has 'promise', ro;
5             has 'called', optional;
6              
7 37 50   37 0 1260 sub reject ($self, $r) {
  37 50       106  
  37         61  
  37         57  
  37         53  
8 37 100       118 return if $self->called;
9 26         110 $self->called(1)->promise->d_reject_continue($r);
10             }
11              
12 90 50   90 0 1417 sub resolve ($self, $v) {
  90 50       205  
  90         132  
  90         149  
  90         133  
13 90 100       269 return if $self->called;
14 80         318 $self->called(1)->promise->d_resolve_continue($v);
15             }
16              
17             1;
18              
19             __END__