Branch Coverage

blib/lib/Mojo/Promise.pm
Criterion Covered Total %
branch 46 60 76.6


line true false branch
21 0 0 wantarray ? :
0 0 if $self->{'status'} eq "resolve"
22 0 0 if ref $results[0] or $results[0] =~ /\n/u
53 364 7 if $self->{'handled'} or ($self->{'status'} // "") ne "reject" or not $self->{'results'}
69 2 2 ref $_[0] eq 'HASH' ? :
71 2 2 if not $options->{'concurrency'} or @items <= $options->{'concurrency'}
77 3 6 unless @items
92 2 802 if @_
109 105 438 if $self->{'results'}
119 0 46 if (my $loop = $self->ioloop)->is_running
134 8 54 if ($type == 1) { }
42 12 elsif ($type == 2) { }
6 6 elsif ($type == 3) { }
143 9 27 if --$remaining <= 0
156 1 3 if --$remaining <= 0
167 2 3 if --$remaining <= 0
172 0 1 if --$remaining <= 0
192 0 880 unless my $results = $self->{'results'}
193 783 97 $self->{'status'} eq 'resolve' ? :
211 40 11 unless $before or $handled
220 38 839 unless (ref $self)
221 4 0 if $thenable and $status eq "resolve" and $results[0]->isa("Mojo::Promise")
225 67 806 if ($thenable and $status eq 'resolve') { }
775 31 elsif (not $self->{'results'}) { }
239 0 0 if builtin::blessed($results[0]) and $results[0]->can("then")
240 0 0 unless $self->{'results'}
247 166 351 unless defined $cb
250 2 349 unless eval { do { @res = &$cb(@results); 1 } }
256 3 3 unless ref $self
257 1 5 if $method eq "reject" and not @results