Branch Coverage

blib/lib/Future/PP.pm
Criterion Covered Total %
branch 284 320 88.7


line true false branch
56 452 0 if defined $cb
66 8 690 $Future::TIMES ? :
79 8 0 unless defined $self->{'label'}
88 0 8 if $GLOBAL_END
89 5 1 if $self->{'ready'} and $self->{'reported'} || !$self->{'failure'}
97 1 2 if ($self->{'ready'} and $self->{'failure'}) { }
2 0 elsif (not $self->{'ready'}) { }
137 1 1 $self->{'cancelled'} ? :
1 2 $self->{'failure'} ? :
1 3 !$self->{'ready'} ? :
147 4 537 if ($Future::TIMES)
155 5 536 unless my $callbacks = delete $self->{'callbacks'}
162 96 107 $fail ? :
333 203 $done ? :
169 40 295 if $done and not $flags & 1
170 3 292 if $fail and not $flags & 2
171 32 260 if $cancelled and not $flags & 4
173 46 214 if $fail
175 23 237 if ($is_future) { }
61 176 elsif ($flags & 96) { }
176 6 1 $fail ? :
16 7 $done ? :
182 2 59 unless ($fseq)
192 53 6 if ($done and $flags & 32 or $fail and $flags & 64) { }
195 2 51 if ($flags & 128) { }
2 49 elsif ($flags & 256) { }
204 22 27 $flags & 8 ? :
29 20 $flags & 16 ? :
209 4 45 unless (eval { do { $f2 = &$code(@args); 1 } })
214 3 42 unless (&blessed($f2) and $f2->isa("Future"))
216 0 3 if ($flags & 512)
229 31 20 if ($f2->is_ready) { }
230 31 0 unless $f2->{'cancelled'}
238 119 57 $flags & 8 ? :
57 119 $flags & 16 ? :
250 308 92 if (ref $self) { }
251 3 305 if $self->{'cancelled'}
252 0 305 if $self->{'ready'}
253 0 305 if $self->{'subs'}
262 1 91 if ($Future::TIMES)
275 2 135 if (ref $exception eq "Future::Exception")
280 0 137 unless $exception
282 80 57 if (ref $self) { }
283 1 79 if $self->{'cancelled'}
284 0 79 if $self->{'ready'}
285 0 79 if $self->{'subs'}
294 1 56 if ($Future::TIMES)
308 0 328 unless $is_future or _callable($code)
311 23 305 if $self->{'ready'}
314 221 84 if ($is_future)
351 20 173 unless my $on_cancel = $self->{'on_cancel'}
354 3 170 if (@$on_cancel >= 8 and $self->{'empty_on_cancel_slots'} >= "0.5" * @$on_cancel)
358 87 88 if defined $on_cancel->[$idx]
371 0 163 unless $is_future or _callable($code)
374 38 125 if ($self->{'ready'}) { }
378 10 28 if $fail
381 8 1 $fail ? :
25 9 $done ? :
34 4 $is_future ? :
404 1 91 unless $self->{'ready'}
405 9 82 if (my $failure = $self->{'failure'})
408 2 7 if @$failure > 1
409 3 6 !ref($exception) && $exception =~ /\n$/ ? :
411 2 80 if $self->{'cancelled'}
412 43 37 unless wantarray
419 5 5 unless $self->{'ready'}
426 3 1 if $self->{'ready'}
436 0 89 unless $is_future or _callable($code)
439 27 62 if ($self->{'ready'}) { }
440 12 15 if $self->{'failure'} or $self->{'cancelled'}
443 14 1 $is_future ? :
455 2 142 unless $self->{'ready'}
456 58 86 unless $self->{'failure'}
458 70 16 unless wantarray
468 0 88 unless $is_future or _callable($code)
471 30 58 if ($self->{'ready'}) { }
472 18 12 unless $self->{'failure'}
476 10 2 $is_future ? :
489 8 108 if $self->{'ready'}
493 39 69 $on_cancel ? :
494 13 42 unless defined $code
496 20 22 $is_future ? :
552 0 112 unless $flags & 384 or _callable($code)
555 4 108 unless (defined wantarray)
559 38 74 if ($f1->is_ready)
562 3 35 if $f1->is_done and not $flags & 32 or $f1->{'failure'} and not $flags & 64
564 2 33 if ($flags & 128) { }
2 31 elsif ($flags & 256) { }
574 13 18 $flags & 8 ? :
4 0 $f1->{'failure'} ? :
16 4 $f1->is_done ? :
20 11 $flags & 16 ? :
579 2 29 unless (eval { do { $fseq = &$code(@args); 1 } })
583 8 21 unless (&blessed($fseq) and $fseq->isa("Future"))
585 0 8 if $flags & 512
599 66 8 unless $flags & 384
611 4 46 @_ % 2 ? :
614 44 4 if ($done_code and not @catch_list and not $fail_code)
663 1 3 @_ % 2 ? :
675 7 4 @_ % 2 ? :
678 3 8 if ($done_code and not @catch_list and not $fail_code)
698 0 1 @_ % 2 ? :
721 1 2 if ($self->{'cancelled'}) { }
0 2 elsif ($self->{'failure'}) { }
744 0 89 unless &blessed($sub) and $sub->isa("Future")
760 5 3 if $sub and not $sub->{'ready'}
772 2 11 unless (@subs)
784 1 10 unless ($pending)
792 0 15 unless my $self = $weakself
795 5 10 if $pending
802 15 3 unless $sub->{'ready'}
813 2 13 unless (@subs)
824 2 20 if $sub->{'ready'} and not $sub->{'cancelled'}
827 2 11 if ($immediate_ready)
829 0 3 unless $sub->{'ready'}
832 0 2 if ($immediate_ready->{'failure'}) { }
846 0 19 unless my $self = $weakself
847 6 13 if $self->{'result'} or $self->{'failure'}
849 2 6 if --$pending and $_[0]{'cancelled'}
851 2 9 if ($_[0]{'cancelled'}) { }
2 7 elsif ($_[0]{'failure'}) { }
862 6 14 unless $sub->{'ready'}
870 1 19 if $sub->{'cancelled'}
883 2 14 unless (@subs)
894 1 26 if $sub->{'cancelled'}
895 1 1 if $sub->{'ready'} and $sub->{'failure'}
898 2 12 if ($immediate_failure)
900 1 3 unless $sub->{'ready'}
912 1 11 unless ($pending)
920 0 23 unless my $self = $weakself
921 5 18 if $self->{'result'} or $self->{'failure'}
923 4 14 if ($_[0]{'cancelled'}) { }
3 11 elsif ($_[0]{'failure'}) { }
926 2 5 unless $sub->{'ready'}
933 3 3 unless $sub->{'ready'}
939 7 4 if $pending
947 23 0 unless $sub->{'ready'}
958 2 11 unless (@subs)
970 1 3 if $sub->{'ready'} and not $sub->{'failure'} and not $sub->{'cancelled'}
971 15 3 unless $sub->{'ready'}
974 1 10 if ($immediate_done)
976 2 0 $sub->{'ready'} ? :
987 9 1 unless $sub->{'ready'}
990 1 9 if ($immediate_fail)
1000 0 15 unless my $self = $weakself
1001 2 13 if $self->{'result'} or $self->{'failure'}
1003 2 4 if --$pending and $_[0]{'cancelled'}
1005 2 9 if ($_[0]{'cancelled'}) { }
3 6 elsif ($_[0]{'failure'}) { }
1010 2 1 if $pending
1018 2 10 unless $sub->{'ready'}
1025 15 1 unless $sub->{'ready'}
1034 0 7 unless $self->{'subs'}
1041 0 7 unless $self->{'subs'}
1048 0 9 unless $self->{'subs'}
1049 15 3 if $_->{'ready'} and not $_->{'failure'}
1055 0 4 unless $self->{'subs'}
1056 8 0 if $_->{'ready'}
1062 0 6 unless $self->{'subs'}
1063 12 0 if $_->{'ready'}