Branch Coverage

blib/lib/Ryu/Source.pm
Criterion Covered Total %
branch 184 320 57.5


line true false branch
250 1 0 ref $class ? :
251 0 1 if (my $from_class = builtin::blessed($_[0])) { }
1 0 elsif (my $ref = ref $_[0]) { }
252 0 0 if ($from_class->isa('Future')) { }
255 0 0 if ($f->failure) { }
0 0 elsif (not $f->is_cancelled) { }
269 1 0 if ($ref eq 'ARRAY') { }
0 0 elsif ($ref eq 'GLOB') { }
279 0 0 if (my $fh = *{$_[0];}{'IO'}) { }
429 0 0 if ($args{'continuous'}) { }
431 0 0 if length $in < 16
442 0 0 if $args{'continuous'} and length $in < 16
524 4 3 !ref($code) ? :
3 7 builtin::blessed($_) ? :
555 0 5 unless (Ref::Util::XS::is_plain_coderef($code))
566 0 9 unless my $src = $weak_sauce
571 0 5 unless my $src = $weak_sauce
574 2 3 if ($f->is_failed)
577 2 0 unless $src->is_ready
582 2 1 unless %{$src->{'waiting'};}
589 0 7 unless my $src = $weak_sauce
592 3 4 if (Ref::Util::XS::is_plain_arrayref($item)) { }
4 0 elsif (builtin::blessed($item) and $item->isa(__PACKAGE__)) { }
595 0 9 if $src->is_ready
601 1 1 if $item->is_ready
607 0 5 unless my $src = $weak_sauce
648 0 0 unless $size and $size > 0
672 0 1 unless $size and $size > 0
683 0 1 if @batch
775 0 0 unless $src->_completed->is_ready
801 29 1 @_ != 1 ? :
815 27 2 unless $src->_completed->is_ready or @pending
823 0 109 unless my $src = $weak_src
824 2 4 if (@pending >= $args{'high'} and $self and not $self->is_paused($src))
831 2 107 if @pending <= $args{'low'} and $self->is_paused($src)
833 12 97 if @pending
838 2 95 if $self->_completed->is_ready and not $src->_completed->is_ready
843 0 29 if $self and $self->is_paused($src)
852 2 27 if @pending
855 0 27 unless $src->is_ready
960 0 0 if ($args{'max_items'}) { }
964 0 0 unless ((my $f = $queue->push($_))->is_ready and not $self->is_paused)
1025 1 1 if $low and $self->size <= $low
1032 0 6 unless my $src = $weak_sauce
1033 1 5 unless (my $buf = $weak_buffer)
1038 1 4 if $high and $buf->size >= $high
1039 2 3 if $low and $buf->size <= $low
1084 0 1 if builtin::blessed($sources[-1])
1088 1 0 if ref $self
1096 4 1 if @sources == keys %seen
1103 0 0 if $combined->_completed->is_ready
1134 0 0 if builtin::blessed($sources[-1])
1143 0 0 if $combined->_completed->is_ready
1149 0 0 if keys %seen
1154 0 0 if $combined->is_ready
1174 4 0 if ref $self
1177 0 16 if $combined->_completed->is_ready
1209 0 5 if $self->_completed->is_ready
1278 1 5 if (not defined $v) { }
2 3 elsif ($k eq $data) { }
1286 0 3 builtin::blessed($rslt) && $rslt->isa('Future') ? :
1331 1 4 unless %pending or $src_completed->is_ready
1338 2 1 if $_ and not $_->is_ready
1349 1 12 if (not $paused and $high and keys %pending >= $high)
1359 1 0 unless $src_completed->is_ready
1362 1 11 if ($paused and keys %pending <= $low)
1367 6 6 if %pending
1368 2 4 if $all_finished and not $src_completed->is_ready
1412 17 5 if (defined $_) { }
1413 7 10 unless $seen{$_}++
1415 1 4 unless $undef++
1433 17 1 if ($active) { }
1434 10 7 if (defined $prev ^ defined $_) { }
5 2 elsif (defined $_) { }
1437 3 2 if $prev ne $_
1464 0 0 if $src->is_ready
1472 0 0 unless $f->is_done
1495 0 0 unless (shift())->is_done
1518 0 0 unless (shift())->is_done
1540 0 0 unless (shift())->is_done
1579 0 1 if $src->is_ready
1583 3 2 unless $count-- > 0
1600 0 1 if $src->is_ready
1606 3 2 if @pending > $count
1629 1 1 if (ref $condition eq 'CODE') { }
1 0 elsif (builtin::blessed($condition) and $condition->isa('Future')) { }
1631 3 2 if $reached ||= &$condition($_)
1635 0 1 if $src->is_ready
1636 0 1 if $cond->is_failed
1637 0 1 if $cond->is_cancelled
1639 2 2 if $condition->is_done
1668 0 0 if (builtin::blessed($condition) and $condition->isa('Ryu::Source')) { }
1671 0 0 if $src->is_ready
1676 0 0 unless $src->is_ready
1681 0 0 if (ref $condition eq 'CODE') { }
0 0 elsif (builtin::blessed($condition) and $condition->isa('Future')) { }
1683 0 0 unless $reached ||= &$condition($_)
1687 0 0 if $src->is_ready
1688 0 0 if $cond->is_failed
1689 0 0 if $cond->is_cancelled
1691 0 0 unless $condition->is_done
1711 0 2 unless $count > 0
1717 3 2 if --$count
1759 1 0 if $sf->is_ready
1761 0 0 unless $f->is_done
1766 0 4 if $src->_completed->is_ready
1767 3 1 unless &$code($_)
1786 0 1 if $src->_completed->is_ready
1791 0 5 if $src->_completed->is_ready
1792 5 0 if &$code($_)
1812 0 12 unless (shift())->is_done
1832 0 1 unless (shift())->is_done
1868 6 2 if defined $max and $max > $_
1888 4 4 if defined $min and $min < $_
1930 0 9 if $_ < $min
1931 8 1 if $_ > $max
1970 37 14 if (my $ref = ref $args{$k}) { }
1971 15 22 if ($ref eq 'Regexp') { }
12 10 elsif ($ref eq 'ARRAY') { }
10 0 elsif ($ref eq 'CODE') { }
1972 8 7 unless defined $v and $v =~ /$args{$k}/
1974 7 5 unless defined $v and &List::Util::any(sub { $v eq $_; } , @{$args{$k};})
1981 1 13 unless defined $v
1988 15 36 if (builtin::blessed($item)) { }
36 0 elsif (my $ref = ref $item) { }
1991 9 6 unless &$check($k, $v)
1994 36 0 if ($ref eq 'HASH') { }
1997 21 15 unless &$check($k, $v)
2007 10 2 @_ > 1 ? :
2009 2 0 if (my $ref = ref $code)
2010 0 2 if ($ref eq 'Regexp') { }
2 0 elsif ($ref eq 'CODE') { }
2021 3 1 if &$code($item)
2039 0 0 unless builtin::blessed($item)
2040 0 0 if grep $item->isa($_), @isa
2054 31 566 unless my(@handlers) = @{$self->{'on_item'}}
2056 0 598 if $completion->is_ready
2078 0 0 if (my(@handlers) = @{$self->{'on_batch'}})
2080 0 0 if $completion->is_ready
2095 0 0 unless @{$self->{'on_item'}}
2152 181 3 unless $self->{'cancel_on_ready'}
2153 83 101 if $self->parent
2162 78 0 if (&List::UtilsBy::extract_by(sub { $addr == builtin::refaddr($_); } , \@{$$self{"children"};}))
2168 71 7 if $self->is_ready
2169 0 7 if @{$self->{'children'};}
2222 0 3 unless $self->{'on_item'}
2227 1 2 unless $f->is_ready
2238 84 8 unless $_[0]->_completed->is_ready
2268 0 0 if defined wantarray
2269 0 0 if (my $parent = $self->parent)
2300 1 53 if $self->{'on_get'}
2301 27 27 unless my $parent = $self->parent
2302 0 27 unless my $code = $parent->can("prepare_await")
2315 96 1 if (my $class = ref $self) { }
2349 14 41 if exists $args{'cleanup'}
2350 29 26 unless $src->is_ready or not $args{'finish_source'} // 1
2372 0 0 if $src->is_ready
2382 0 184 if ${^GLOBAL_PHASE} eq "DESTRUCT"
2384 10 174 unless $self->_completed->is_ready
2393 0 0 if (builtin::blessed($sub) and $sub->isa('Ryu::Source')) { }