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
51 364 7 if $self->{'handled'} or ($self->{'status'} // "") ne "reject" or not $self->{'results'}
67 2 2 ref $_[0] eq 'HASH' ? :
69 2 2 if not $options->{'concurrency'} or @items <= $options->{'concurrency'}
75 3 6 unless @items
90 2 802 if @_
107 105 438 if $self->{'results'}
117 0 46 if (my $loop = $self->ioloop)->is_running
132 8 54 if ($type == 1) { }
42 12 elsif ($type == 2) { }
6 6 elsif ($type == 3) { }
141 9 27 if --$remaining <= 0
154 1 3 if --$remaining <= 0
165 2 3 if --$remaining <= 0
170 0 1 if --$remaining <= 0
190 0 880 unless my $results = $self->{'results'}
191 783 97 $self->{'status'} eq 'resolve' ? :
209 40 11 unless $before or $handled
218 38 839 unless (ref $self)
219 4 0 if $thenable and $status eq "resolve" and $results[0]->isa("Mojo::Promise")
223 67 806 if ($thenable and $status eq 'resolve') { }
775 31 elsif (not $self->{'results'}) { }
237 0 0 if &blessed($results[0]) and $results[0]->can("then")
238 0 0 unless $self->{'results'}
245 166 351 unless defined $cb
248 2 349 unless eval { do { @res = &$cb(@results); 1 } }
254 3 3 unless ref $self
255 1 5 if $method eq "reject" and not @results