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   4527 use Evo '-Class *';
  12         27  
  12         63  
3              
4             has 'promise', ro;
5             has 'called', optional;
6              
7 36 50   36 0 1224 sub reject ($self, $r) {
  36 50       80  
  36         57  
  36         60  
  36         47  
8 36 100       118 return if $self->called;
9 25         97 $self->called(1)->promise->d_reject_continue($r);
10             }
11              
12 90 50   90 0 1454 sub resolve ($self, $v) {
  90 50       196  
  90         126  
  90         140  
  90         124  
13 90 100       257 return if $self->called;
14 80         299 $self->called(1)->promise->d_resolve_continue($v);
15             }
16              
17             1;
18              
19             __END__