Branch Coverage

blib/lib/MCE/Shared/Cache.pm
Criterion Covered Total %
branch 61 216 28.2


line true false branch
47 0 0 unless ($_[0][7])
68 0 2 ref $_[0] eq 'HASH' ? :
70 2 0 unless (defined $opts)
73 2 2 if (@_ and $_[0] =~ /^(max_keys|max_age)$/)
86 0 2 if @_
94 0 25 @_ == 4 ? :
96 25 0 if (not defined $exptime) { }
0 0 elsif (not &looks_like_number($exptime)) { }
103 0 25 if (defined(my $off = $$indx{$_[1]}))
107 0 0 $exptime >= 0 ? :
112 0 0 if (not $off) { }
0 0 elsif ($off != @{$keys;} - 1) { }
113 0 0 if @{$keys;} == 1
119 0 0 if ${$gcnt;} and not defined $keys->[0]
122 0 0 if ${$begi;} > "1000000000"
129 0 0 if ++${$gcnt;} > @{$keys;} * "0.667"
139 0 25 $exptime >= 0 ? :
144 9 16 if (defined ${$size;} and @{$keys;} - ${$gcnt;} > ${$size;})
149 1 8 if ${$gcnt;} and not defined $keys->[0]
152 0 9 if ${$begi;} > "1000000000"
163 0 2 unless defined(my $off = $_[0][2]{$_[1]})
171 0 2 if $keys->[$off] >= 0 and $keys->[$off] < &MCE::Shared::Cache::time()
176 2 0 if (not $off) { }
0 0 elsif ($off - ${$gcnt;} < @{$keys;} - ${$gcnt;} >> 1) { }
177 1 1 if @{$keys;} == 1
183 0 1 if ${$gcnt;} and not defined $keys->[0]
186 0 1 if ${$begi;} > "1000000000"
193 0 0 if ++${$gcnt;} > @{$keys;} * "0.667"
204 0 3 unless defined(my $off = delete $$indx{$_[1]})
209 1 2 if (not $off) { }
1 1 elsif ($off == @{$keys;} - 1) { }
212 0 1 if (${$gcnt;} and not defined $keys->[0]) { }
0 1 elsif (not @{$keys;}) { }
225 0 1 if (${$gcnt;} and not defined $keys->[-1]) { }
0 1 elsif (not @{$keys;}) { }
238 0 1 if ++${$gcnt;} > @{$keys;} * "0.667"
262 1 1 unless defined(my $off = $self->[2]{$key})
266 0 1 if $self->[1][$off] >= 0 and $self->[1][$off] < &MCE::Shared::Cache::time()
305 0 0 if $cloning
318 0 0 if $cloning
399 0 0 @_ == 3 ? :
401 0 0 if (not defined $exptime) { }
0 0 elsif (not &looks_like_number($exptime)) { }
408 0 0 if (defined(my $off = $$indx{$_[1]}))
412 0 0 if $keys->[$off] >= 0 and $keys->[$off] < &MCE::Shared::Cache::time()
416 0 0 $exptime >= 0 ? :
421 0 0 if (not $off) { }
0 0 elsif ($off != @{$keys;} - 1) { }
422 0 0 if @{$keys;} == 1
428 0 0 if ${$gcnt;} and not defined $keys->[0]
431 0 0 if ${$begi;} > "1000000000"
438 0 0 if ++${$gcnt;} > @{$keys;} * "0.667"
447 0 0 $exptime >= 0 ? :
452 0 0 if (defined ${$size;} and @{$keys;} - ${$gcnt;} > ${$size;})
457 0 0 if ${$gcnt;} and not defined $keys->[0]
460 0 0 if ${$begi;} > "1000000000"
473 0 13 unless defined $k
474 13 0 if $keys->[$i] < 0 or $keys->[$i] > $time
482 0 19 if $i
496 2 0 if not defined $secs or $secs eq "never"
497 0 0 if not $secs or $secs eq "now"
498 0 0 if $secs < "0.0001"
500 0 0 if $secs =~ /^(\d*\.?\d*)\s*([smhdw]?)/i
519 0 4 if not defined $size or $size eq "unlimited"
520 1 3 if not $size or $size < 0
522 3 0 if $size =~ /^(\d*\.?\d*)\s*([km]?)/i
541 0 0 ref $_[0] eq 'HASH' ? :
555 0 0 if (not @keys) { }
0 0 elsif (@keys == 1 and $keys[0] =~ /^(?:key|val)[ ]+\S\S?[ ]+\S/) { }
566 0 0 unless @keys
580 0 11 if (@_ == 1 and $_[0] =~ /^(?:key|val)[ ]+\S\S?[ ]+\S/) { }
8 3 elsif (wantarray) { }
585 0 0 exists $data->{$_} ? :
0 8 @_ ? :
600 1 7 ${$self->[4];} ? :
611 0 0 if (@_ == 1 and $_[0] =~ /^(?:key|val)[ ]+\S\S?[ ]+\S/) { }
0 0 elsif (wantarray) { }
616 0 0 @_ ? :
631 0 2 if (@_ == 1 and $_[0] =~ /^(?:key|val)[ ]+\S\S?[ ]+\S/) { }
0 2 elsif (wantarray) { }
635 0 0 @_ ? :
660 0 0 if (@_ == 2 and defined $secs) { }
0 0 elsif (@_ == 2) { }
667 0 0 if (defined wantarray)
668 0 0 ${$expi;} > 0 ? :
0 0 defined ${$expi;} ? :
677 2 3 if (@_ == 2 and defined $size) { }
0 3 elsif (@_ == 2) { }
690 0 3 if ${$begi;} > "1000000000"
699 3 2 if (defined wantarray)
700 3 0 defined ${$$self[6];} ? :
712 0 0 if $self->exists($key)
724 0 0 unless $self->exists(shift())
735 0 0 @_ ? :
747 0 1 defined wantarray ? :
767 0 7 if defined $k and $k >= 0 and $k < $time
770 7 0 if defined $k
788 0 0 defined $_[3] ? :
795 0 0 defined $_[2] ? :
802 0 0 defined $_[3] ? :
809 0 0 defined $_[2] ? :
816 0 0 defined $_[3] ? :
823 0 0 defined $_[2] ? :
830 0 0 defined $_[2] ? :
837 0 0 defined $_[3] ? :
848 0 0 if exists $_[0][0]{$_[1]}
850 0 0 defined $_[3] ? :
864 0 6 defined $_[1] ? :