Branch Coverage

blib/lib/Ryu/Source.pm
Criterion Covered Total %
branch 171 306 55.8


line true false branch
248 0 0 ref $class ? :
249 0 0 if (my $from_class = &Scalar::Util::blessed($_[0])) { }
0 0 elsif (my $ref = ref $_[0]) { }
250 0 0 if ($from_class->isa('Future')) { }
253 0 0 if ($f->failure) { }
0 0 elsif (not $f->is_cancelled) { }
267 0 0 if ($ref eq 'ARRAY') { }
0 0 elsif ($ref eq 'GLOB') { }
274 0 0 if (my $fh = *{$_[0];}{'IO'}) { }
424 0 0 if ($args{'continuous'}) { }
426 0 0 if length $in < 16
437 0 0 if $args{'continuous'} and length $in < 16
519 4 3 !ref($code) ? :
3 7 &Scalar::Util::blessed($_) ? :
548 0 3 unless (XXX)
559 0 6 unless my $src = $weak_sauce
564 0 2 unless my $src = $weak_sauce
566 1 1 unless %{$src->{'waiting'};}
572 0 6 unless my $src = $weak_sauce
575 3 3 if (XXX) { }
3 0 elsif (&Scalar::Util::blessed($item) and $item->isa('Ryu::Source')) { }
578 0 9 if $src->is_ready
584 0 1 if $item->is_ready
590 0 5 unless my $src = $weak_sauce
632 0 0 unless $size and $size > 0
656 0 1 unless $size and $size > 0
667 0 1 if @batch
759 0 0 unless $src->_completed->is_ready
785 2 1 @_ != 1 ? :
799 1 0 unless $src->_completed->is_ready or @pending
806 0 17 unless my $src = $weak_src
807 2 4 if (@pending >= $args{'high'} and $self and not $self->is_paused($src))
814 17 0 if ($self)
815 2 15 if @pending < $args{'low'} and $self->is_paused($src)
820 0 0 if $self->_completed->is_ready and not @pending and not $src->_completed->is_ready
833 0 1 if @pending
836 0 1 unless $src->is_ready
958 1 1 if $low and $self->size <= $low
965 0 6 unless my $src = $weak_sauce
966 1 5 unless (my $buf = $weak_buffer)
971 1 4 if $high and $buf->size >= $high
972 2 3 if $low and $buf->size <= $low
991 0 1 if &Scalar::Util::blessed($sources[-1])
995 1 0 if ref $self
1003 4 1 if @sources == keys %seen
1010 0 0 if $combined->_completed->is_ready
1041 0 0 if &Scalar::Util::blessed($sources[-1])
1050 0 0 if $combined->_completed->is_ready
1056 0 0 if keys %seen
1061 0 0 if $combined->is_ready
1081 4 0 if ref $self
1084 0 16 if $combined->_completed->is_ready
1116 0 5 if $self->_completed->is_ready
1185 1 5 if (not defined $v) { }
2 3 elsif ($k eq $data) { }
1193 0 3 &Scalar::Util::blessed($rslt) && $rslt->isa('Future') ? :
1238 1 4 unless %pending or $src_completed->is_ready
1245 2 1 if $_ and not $_->is_ready
1255 1 4 if $high and keys %pending >= $high and not $src->is_paused
1262 1 0 unless $src_completed->is_ready
1265 1 3 if $low and keys %pending <= $low and $src->is_paused
1267 6 6 if %pending
1268 2 4 if $all_finished and not $src_completed->is_ready
1312 17 5 if (defined $_) { }
1313 7 10 unless $seen{$_}++
1315 1 4 unless $undef++
1333 17 1 if ($active) { }
1334 10 7 if (defined $prev ^ defined $_) { }
5 2 elsif (defined $_) { }
1337 3 2 if $prev ne $_
1364 0 0 if $src->is_ready
1372 0 0 unless $f->is_done
1395 0 0 unless (shift())->is_done
1418 0 0 unless (shift())->is_done
1440 0 0 unless (shift())->is_done
1479 0 1 if $src->is_ready
1483 3 2 unless $count-- > 0
1500 0 1 if $src->is_ready
1506 3 2 if @pending > $count
1529 1 1 if (ref $condition eq 'CODE') { }
1 0 elsif (&Scalar::Util::blessed($condition) and $condition->isa('Future')) { }
1531 3 2 if $reached ||= &$condition($_)
1535 0 1 if $src->is_ready
1536 0 1 if $cond->is_failed
1537 0 1 if $cond->is_cancelled
1539 2 2 if $condition->is_done
1568 0 0 if (&Scalar::Util::blessed($condition) and $condition->isa('Ryu::Source')) { }
1571 0 0 if $src->is_ready
1576 0 0 unless $src->is_ready
1581 0 0 if (ref $condition eq 'CODE') { }
0 0 elsif (&Scalar::Util::blessed($condition) and $condition->isa('Future')) { }
1583 0 0 unless $reached ||= &$condition($_)
1587 0 0 if $src->is_ready
1588 0 0 if $cond->is_failed
1589 0 0 if $cond->is_cancelled
1591 0 0 unless $condition->is_done
1611 0 2 unless $count > 0
1617 3 2 if --$count
1659 1 0 if $sf->is_ready
1661 0 0 unless $f->is_done
1666 0 4 if $src->_completed->is_ready
1667 3 1 unless &$code($_)
1686 0 1 if $src->_completed->is_ready
1691 0 5 if $src->_completed->is_ready
1692 5 0 if &$code($_)
1712 0 2 unless (shift())->is_done
1732 0 1 unless (shift())->is_done
1768 6 2 if defined $max and $max > $_
1788 4 4 if defined $min and $min < $_
1830 0 9 if $_ < $min
1831 8 1 if $_ > $max
1870 37 14 if (my $ref = ref $args{$k}) { }
1871 15 22 if ($ref eq 'Regexp') { }
12 10 elsif ($ref eq 'ARRAY') { }
10 0 elsif ($ref eq 'CODE') { }
1872 8 7 unless defined $v and $v =~ /$args{$k}/
1874 7 5 unless defined $v and &List::Util::any(sub { $v eq $_; } , @{$args{$k};})
1881 1 13 unless defined $v
1888 15 36 if (&Scalar::Util::blessed($item)) { }
36 0 elsif (my $ref = ref $item) { }
1891 9 6 unless &$check($k, $v)
1894 36 0 if ($ref eq 'HASH') { }
1897 21 15 unless &$check($k, $v)
1907 10 2 @_ > 1 ? :
1909 2 0 if (my $ref = ref $code)
1910 0 2 if ($ref eq 'Regexp') { }
2 0 elsif ($ref eq 'CODE') { }
1921 3 1 if &$code($item)
1939 0 0 unless &Scalar::Util::blessed($item)
1940 0 0 if grep $item->isa($_), @isa
1953 7 411 unless $self->{'on_item'}
31 387 unless my(@handlers) = @{[] unless $self->{'on_item'};}
1955 0 419 if $completion->is_ready
2010 79 3 unless $self->{'cancel_on_ready'}
2011 37 45 if $self->parent
2019 37 0 if (&List::UtilsBy::extract_by(sub { $addr == &Scalar::Util::refaddr($_); } , \@{$$self{'children'};}))
2025 31 6 if $self->is_ready
2026 0 6 if @{$self->{'children'};}
2079 0 3 unless $self->{'on_item'}
2084 1 2 unless $f->is_ready
2095 32 2 unless $_[0]->_completed->is_ready
2125 0 0 if defined wantarray
2126 0 0 if (my $parent = $self->parent)
2157 0 189 if $self->{'on_get'}
2158 126 63 unless my $parent = $self->parent
2159 0 63 unless my $code = $parent->can('prepare_await')
2172 57 1 if (my $class = ref $self) { }
2201 4 21 if exists $args{'cleanup'}
2204 19 6 unless $src->is_ready
2227 0 0 if $src->is_ready
2237 0 82 if ${^GLOBAL_PHASE} eq 'DESTRUCT'
2239 4 78 unless $self->_completed->is_ready
2248 0 0 if (&Scalar::Util::blessed($sub) and $sub->isa('Ryu::Source')) { }