Condition Coverage

blib/lib/List/Gen.pm
Criterion Covered Total %
condition 81 395 20.5


and 3 conditions

line !l l&&!r l&&r condition
66 6 6 0 @_ == 2 and !$_[1] || $_[1] eq '*'
75 0 1 2 @_ > 1 && $_[1] == 0
236 804 0 0 DEBUG and B::svref_2object($$obj{$name})->GV->NAME =~ /__ANON__/
250 16 0 0 ref $_[0] and blessed($_[0])
402 0 0 0 @_ == 2 and ref $_[1]
0 0 0 @_ == 2 and ref $_[1] and isagen $_[1]
415 10 0 0 @$source == 1 and ref $$source[0]
10 0 0 @$source == 1 and ref $$source[0] and isagen $$source[0]
1296 0 0 176 &Scalar::Util::reftype($_[0]) eq 'HASH' and $_[0]{$_}
1453 4 0 1 $lh eq '<<' && $rh eq '>>'
1458 4 1 0 $lh eq '<<' && $lsize < $size
0 0 5 $rh eq '>>' && $rsize < $size
1504 0 0 0 ref $_ && reftype $_ eq 'ARRAY'
1677 0 0 0 ref $_[0] eq 'REF' and $code_ok{ref ${$_[0];}}
0 0 0 $dwim_code_strings and ref $_[0] eq 'SCALAR'
1709 3 0 0 @_ == 1 and isagen($_[0]) || canglob($_[0])
1944 0 0 0 @_ && $_[0] < 9**9**9
0 0 0 @_ == 2 && $_[0] < $src->size
1973 20 0 3 @_ && $_[0] < 9**9**9
1993 0 0 0 @_ and &Scalar::Util::openhandle($_[0])
2029 0 0 0 &Scalar::Util::openhandle($_) && ($fh = $_)
2043 0 0 0 $n == 1 and not $self->is_mutable
2083 0 0 0 $i < $size - 1 and $seen{$i}
2085 0 0 0 $i > 0 and $seen{$i}
2221 5 0 0 $ysize >= 9**9**9 and not $ys_mutable
2226 5 0 0 $xsize >= 9**9**9 and not $xs_mutable
2244 0 0 0 $got and int $_ / 2 == $i
2593 0 0 0 ref $_ and &List::Gen::isagen($_)
2596 0 0 0 @stack and ref $stack[-1]
0 0 0 @stack and ref $stack[-1] and &List::Gen::isagen($stack[-1])
2600 0 0 0 ref $_ and &List::Gen::isagen($_)
2711 38 67 0 ref $_[0] && substr(ref $_[0], 0, 14) eq 'List::Gen::era' && $_[0]
0 12 0 ref $_ && substr(ref $_, 0, 14) eq 'List::Gen::era' && $_
2730 0 0 0 !$exempt{'mutable'}{$type} && $src->mutable
2822 23 40 0 @_ > 1 and $_[1] eq '*' || \$_[1] == \**
2827 0 92 32 defined $_ and /^[a-z]+$/i
92 26 6 defined $_ and /^[a-z]+$/i and not looks_like_number $_
2883 0 3 9 /^[a-z]+$/i and not looks_like_number $_
2951 34 0 12 $#_ and &range
24 10 0 ref $_[0] and do { $_[0] = &${$_[0];}() if ref $_[0] eq 'List::Gen::Thunk'; ref $_[0] eq 'ARRAY' and &makegen unless isagen $_[0] }
1 23 0 $_[0] and $_[0] =~ /$canglob/
24 0 0 $_[0] and $_[0] =~ /$canglob/ and isagen &glob($_[0] =~ /\.{2,3}/ ? $_[0] : "$_[0]...")
1 0 23 looks_like_number($_[0]) and range int $_[0]
2953 0 0 0 ref $_[0] eq 'ARRAY' and &makegen
3189 0 7 0 isagen $size and $size->is_mutable
3219 0 0 0 @_ == 2 and ref $_[1] eq 'List::Gen::From_Check'
3249 0 0 0 isagen $size and $size->is_mutable
3269 0 0 0 $i == 0 and $from
3271 0 0 0 $i >= $pos and $pos < $size
3334 0 0 0 catch_done and do { if (ref $@) { push @list, map({ref $_ eq 'List::Gen::Thunk' ? \&$$_() : \$_;} @{$@;}); $size = @list; $$_ = $size foreach (@tails); &$when_done(); return ${$list[$i < $#list ? $i : $#list];}; } else { --$iter; $size = @list; $$_ = $size foreach (@tails); &$when_done(); return; } }
3451 0 0 0 $i == $pos and @last
3464 0 0 0 catch_done and do { if (ref $@) { push @last, map({ref $_ eq 'List::Gen::Thunk' ? \&$$_() : \$_;} @{$@;}); $size = $pos; $$_ = $size foreach (@tails); &$when_done(); return ${shift @last;}; } else { $size = $pos; $$_ = $size foreach (@tails); &$when_done(); return; } }
3571 0 0 0 catch_done and ref $@
0 0 0 catch_done and ref $@ and push @ret, @{$@;}
3896 28 53 0 $_ and s/_//g, s/^-\s+/-/
3916 0 0 8 $reduce && !$_
4123 0 0 0 $n > $max and &$build($n * 10)
4403 0 0 0 @first == 1 and ref $first[0] eq 'ARRAY'
4685 0 0 0 $pos < $src_size and &$check()
4840 0 0 0 $LOOKAHEAD && (!$src->can('index') || $src->isa($class))
4939 0 0 0 $i < $src_size and &$check()
4941 0 0 0 $lookahead and $i + 1 < $src_size
4943 0 0 0 $i + 1 < $src_size and &$check()
5004 0 0 0 defined $size and $_[1] >= $size
5013 0 0 0 catch_done and ref $@ ? do { my $val = $@; $size = $_[1] + 1; &$when_done(); return wantarray ? @$val : pop @$val } : do { $size = $_[1]; &$when_done(); return }
5048 0 0 0 $ok and $i < $size
5361 0 0 0 @_ == 1 and ref $_[0]
0 0 0 @_ == 1 and ref $_[0] and isagen $_[0]
5464 0 0 0 $_ <= $i and done()
5575 0 0 0 isagen $$src[0] and $$src[0]->is_mutable

or 2 conditions

line l !l condition
230 187 0 $class || (next)
1615 120 0 eval(/(..)(.)/ ? "sub {$1\$_[0]$2}" : "sub {$op \$_[0]}") || die($@)
1661 0 52 $src->can('index') || sub { 0; }
1739 0 0 $_[1] || 0
1785 0 0 ref $code || ''
1833 0 0 $_->can($proxy) || (next)
2619 0 0 $_[1] || 4
2730 0 0 $src->can($_) || sub { }
3884 0 32 $pre ||= ''
3893 0 0 $step ||= -1
3898 0 27 $step || 1
4069 0 0 $str ||= ''
4070 0 0 $bits ||= 8
4071 0 0 $size ||= 9**9**9
4674 0 0 $LOOKAHEAD || 0
5175 50 0 eval "sub $_ () {$seq_const{$_}} 1" or die $@
5181 0 0 tied(@$_)->can('sequence') || sub { [$_]; }
5271 0 4 $_->mutable || 0
5611 0 0 $size[$_] || 1

or 3 conditions

line l !l&&r !l&&!r condition
66 3 3 0 !$_[1] || $_[1] eq '*'
221 197 0 0 $class || caller
243 52 145 0 $$obj{-'bless'} || $obj
249 88 0 16 &Scalar::Util::looks_like_number($_[0]) or do { BEGIN {${^WARNING_BITS} = "TUUQUUUUUUUUUUU\025"} $_[0] >= 9**9**9 }
250 0 0 0 $_[0]->isa('Math::BigInt') or $_[0]->isa('Math::BigRat')
0 0 0 $_[0]->isa('Math::BigInt') or $_[0]->isa('Math::BigRat') or $_[0]->isa('Math::BigFloat')
432 0 0 0 $cache{$i} ||= $i < $src_size ? cap(map(&$fetch(undef, $_), $i .. min($last, $i + $n - 1))) : croak("index $_[1] out of bounds [0 .. @{[int $#$source / $n];}]")
438 0 0 0 $cache{$i} ||= $i < @$source ? cap(@$source[$i .. min($last, $i + $n - 1)]) : croak("index $_[1] out of bounds [0 .. @{[int $#$source / $n];}]")
1296 176 0 0 &Scalar::Util::reftype($_[0]) eq 'HASH' and $_[0]{$_} or $_[0]->can($_)
1445 0 0 5 $left->is_mutable or $right->is_mutable
1470 0 0 0 ref $got eq 'ARRAY' or &List::Gen::isagen($got)
1484 0 0 0 ref $_ eq 'ARRAY' or &List::Gen::isagen($_)
1485 0 0 0 $cache{join $;, $l, $lh, $code, $rh, $r} ||= hyper($l, $lh, $code, $rh, $r)
1560 1 7 3 not ref $ys or ref $ys eq 'CODE'
1677 0 0 0 ref $_[0] eq 'REF' and $code_ok{ref ${$_[0];}} or $dwim_code_strings and ref $_[0] eq 'SCALAR'
1709 0 0 0 isagen($_[0]) || canglob($_[0])
1748 0 20 0 $mutable or $size < 2147483648
1783 0 0 0 $inf ||= &List::Gen::range(0, 9**9**9)
1797 0 0 0 ref \$_[1] eq 'GLOB' or $_[1] =~ /^(?:<>?|>=|<=|[^<>]+)$/
2149 0 0 0 $mod ||= @{$ref = &$fetch(undef, $pos = 0);}
2516 0 0 0 $span ||= &$range(1, 9**9**9)
2517 0 0 0 $span{$_[1]} ||= &$range($_[1], 9**9**9)
2518 8 1 0 $span{$_[1]} ||= &$range(0, $_[1] - 1)
2562 45 0 0 $self->can($method) || $search && do { my(@src) = $self->sources; while (@src) { last if $src[0]->can($method); CORE::shift @src; } ; @src ? ($self = $src[0])->can($method) : () }
2625 0 0 0 $cached or $$self{'thread_cached'}
2675 0 0 0 $$self{'thread_blocksize'} || int @_ / $threads + 1
2822 0 0 40 $_[1] eq '*' || \$_[1] == \**
2951 12 0 34 $#_ and &range or ref $_[0] and do { $_[0] = &${$_[0];}() if ref $_[0] eq 'List::Gen::Thunk'; ref $_[0] eq 'ARRAY' and &makegen unless isagen $_[0] }
10 0 24 $#_ and &range or ref $_[0] and do { $_[0] = &${$_[0];}() if ref $_[0] eq 'List::Gen::Thunk'; ref $_[0] eq 'ARRAY' and &makegen unless isagen $_[0] } or $_[0] and $_[0] =~ /$canglob/ and isagen &glob($_[0] =~ /\.{2,3}/ ? $_[0] : "$_[0]...")
0 0 24 $#_ and &range or ref $_[0] and do { $_[0] = &${$_[0];}() if ref $_[0] eq 'List::Gen::Thunk'; ref $_[0] eq 'ARRAY' and &makegen unless isagen $_[0] } or $_[0] and $_[0] =~ /$canglob/ and isagen &glob($_[0] =~ /\.{2,3}/ ? $_[0] : "$_[0]...") or looks_like_number($_[0]) and range int $_[0]
3221 0 0 0 @list or $from++
3283 0 0 0 $pos or $from++
3373 0 0 0 @list or $from++
3495 0 0 0 @last or $from
3841 4 0 4 $1 || $5
3882 0 0 0 $while =~ s/^while\s*/not / or $while =~ s/^until\s*//
3915 5 9 0 @_ == 1 && isagen($_[0]) || &makegen(\@_)
4113 0 0 0 $primes_gen ||= do { &$build(1000); my($n, $lim, $i) = 2; &iterate(sub { '???'; if ($n < 10000000) { $n > $max and &$build($n * 10) until substr $prime, $n++, 1; $n - 1; } else { trial_division: while (1) { ++$n, next unless $n & 1; ($i, $lim) = (3, 1 + int(sqrt $n)); while ($i < $lim) { ++$n, next trial_division unless $n % $i; $i += 2; } ; return $n++; } ; } ; } ) }
4299 0 0 0 $cache{join $sep, @_} ||= cap(&$gen)
4315 0 0 0 $cache{$_[1]} ||= cap(&$fetch(undef, $_[1]))
4487 7 0 0 @_ == 1 && isagen($_[0]) || &makegen(\@_)
5451 8 0 0 isagen or $_ = makegen(@$_)
5452 0 0 8 !defined($_) || $_->is_mutable
0 0 8 $mutable ||= !defined($_) || $_->is_mutable
5497 0 0 0 !defined($_) || $_->is_mutable
0 0 0 $mutable ||= !defined($_) || $_->is_mutable
5578 0 0 0 $i < $_->size or done()
5580 0 0 0 $i < $_->size or done()
5583 0 0 0 $i + 1 < $_->size or do { done(mutable(gen(sub { $i < @$_ ? $$_[$i] : done(); } , $src))) }