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   6258 use Evo '-Class *';
  12         32  
  12         79  
3              
4             has 'promise', ro;
5             has 'called', optional;
6              
7 38 50   38 0 1791 sub reject ($self, $r = undef) {
  38 50       131  
  38         75  
  38         90  
  38         93  
8 38 100       156 return if $self->called;
9 26         152 $self->called(1)->promise->d_reject_continue($r);
10             }
11              
12 93 50   93 0 2265 sub resolve ($self, $v = undef) {
  93 50       247  
  93         176  
  93         176  
  93         232  
13 93 100       328 return if $self->called;
14 82         398 $self->called(1)->promise->d_resolve_continue($v);
15             }
16              
17             1;
18              
19             __END__