Branch Coverage

lib/Math/String/Charset.pm
Criterion Covered Total %
branch 186 240 77.5


line true false branch
73 0 250 if (not ref $_[0]) { }
81 2 248 unless (ref($value) =~ /^(ARRAY|HASH)$/)
86 8 22 if (ref $value->{$k} eq 'ARRAY') { }
4 18 elsif (ref $value->{$k} eq 'HASH') { }
110 229 19 if ($self->{'_error'} eq '')
113 212 17 if ($class eq 'Math::String::Charset')
116 8 204 if $self->{'_type'} == 1
117 0 204 if ($self->{'_type'} == 2 and $self->{'_order'} == 1)
123 8 196 if $self->{'_order'} == 2
128 0 232 if $die_on_error and $self->{'_error'} ne ''
143 0 196 if $self->{'_type'} != 0
145 0 196 if $self->{'_order'} != 1
148 0 218 unless $key =~ /^(start|minlen|maxlen|sep|scale)$/
163 173 75 if ref $value eq 'ARRAY'
170 1 0 if exists $value->{'charlen'} and exists $value->{'sep'}
176 4 243 if exists $value->{'scale'}
179 1 19 if exists $value->{'sets'} and exists $value->{'bi'}
181 231 15 unless (defined $self->{'_type'})
184 16 215 if exists $value->{'sets'}
187 241 5 unless (defined $self->{'_order'})
190 18 223 if exists $value->{'bi'}
194 1 245 if exists $value->{'bi'} and $self->{'_type'} != 0
197 3 242 if exists $value->{'sets'} and $self->{'_type'} == 0
200 6 236 if $self->{'_type'} < 0 or $self->{'_type'} > 2
204 1 235 if $self->{'_type'} == 1 and $self->{'_order'} != 1
206 215 20 if ($self->{'_order'} == 1)
210 1 214 if defined $value->{'end'}
214 0 214 if defined $value->{'bi'}
218 3 231 if $self->{'_order'} < 1 or $self->{'_order'} > 2
222 1 230 if defined $self->{'_sep'} and $self->{'_sep'} eq ''
226 224 6 unless defined $self->{'_minlen'}
227 226 4 unless defined $self->{'_maxlen'}
229 1 229 if $self->{'_minlen'} > $self->{'_maxlen'}
241 196 0 if defined $value->{'start'}
244 179 17 unless defined $self->{'_sep'}
252 179 17 unless (defined $self->{'_sep'})
257 1 2793 if CORE::length $_ != $self->{'_clen'}
284 0 196 if $self->{'_cnum'}->is_zero and $self->{'_minlen'} > 0
293 2 3 if @_ > 0
304 0 0 if defined $self->{'_zero'}
306 0 0 if $self->{'_minlen'} > 0
321 0 0 if $self->{'_minlen'} > 0
332 0 3 if (@_ > 1) { }
342 0 3 unless ref $x
347 0 53 if (ref $x->{$k} eq 'SCALAR') { }
13 40 elsif (ref $x->{$k} eq 'ARRAY') { }
8 32 elsif (ref $x->{$k} eq 'HASH') { }
14 18 elsif (ref $x->{$k}) { }
388 0 0 if $self->{'_maxlen'}->is_inf
451 0 56 if $max < 1
452 0 56 if $max <= $self->{'_cnt'}
471 0 38 unless defined $len
474 0 38 if $len < $self->{'_minlen'} or $len > $self->{'_maxlen'}
477 0 38 if $self->{'_minlen'} > 0
479 15 23 if $self->{'_cnt'} < $len
491 0 4 if $self->{'_cnt'} < $len
504 1 3 if $self->{'_cnt'} < $len
514 106 11 unless defined $self->{'_sep'}
528 1 137 unless defined $str
529 12 125 if ($str eq '')
531 10 2 $self->{'_minlen'} <= 0 ? :
536 8 117 if (defined $self->{'_sep'}) { }
539 3 5 if $chars[0] eq ''
540 0 8 if $chars[-1] eq $self->{'_sep'}
551 2 123 if scalar @chars < $self->{'_minlen'} or scalar @chars > $self->{'_maxlen'}
559 11 226 unless exists $map->{$_}
586 11 0 wantarray ? :
597 0 3 wantarray ? :
605 2 0 wantarray ? :
614 15 91 unless ref $x
616 0 106 unless $x->{'sign'} =~ /^[+-]$/
620 105 1 if ($self->{'_minlen'} <= $ONE)
622 7 98 if ($x->is_zero)
624 0 7 wantarray ? :
628 39 59 if ($x <= $j and $self->{'_minlen'} <= $ONE)
631 0 39 wantarray ? :
640 1 59 if ($digits < $self->{'_minlen'} or $digits > $self->{'_maxlen'})
642 0 1 wantarray ? :
652 44 15 unless defined $s
662 27 32 if $digits > 0
664 0 59 wantarray ? :
675 10 114 if $i == 0
679 43 71 if ($i == $clen)
686 71 0 if (ref $cnum) { }
695 60 11 if (not defined $self->{'_sep'}) { }
722 4 7 if $chars[0] eq ''
739 0 42 if $char > scalar @{$self->{'_ones'};}
748 8 117 unless defined $char and exists $self->{'_map'}{$char}
757 0 81 if $x->is_zero or $x->is_nan or $x->is_inf
763 52 150 if $self->{'_cnt'} < $i
774 0 18 if $count < $self->{'_minlen'}
775 0 18 if defined $self->{'_maxlen'} and $count > $self->{'_maxlen'}
776 4 14 if $count == 0
780 6 8 if defined $self->{'_sep'}
789 0 18 if $count < $self->{'_minlen'}
790 0 18 if defined $self->{'_maxlen'} and $count > $self->{'_maxlen'}
791 4 14 if $count == 0
795 6 8 if defined $self->{'_sep'}
805 3 85 if ($str->{'_cache'} eq '')
824 28 57 if (defined $sep) { }
828 11 17 unless $$s =~ /$sep/
837 10 75 if $str->{'sign'} eq '-'
838 10 75 if (not defined $char or $char >= @{$self->{'_start'};} or $char < 0)
845 22 53 if (defined $sep) { }
861 2 73 if ($str->{'_cache'} eq '')
864 0 2 if $min->is_positive
874 46 27 if (defined $sep) { }
878 16 30 unless $$s =~ /$sep/
887 73 0 if (defined $char and exists $self->{'_map'}{$char}) { }
890 26 47 $str->{'sign'} eq '-' ? :
891 15 58 if ($char < 0 or $char >= @{$self->{'_start'};})
903 33 25 if (defined $self->{'_sep'}) { }
932 0 4 if (ref $_[0] eq 'HASH') { }
948 0 4 if $depth < 1 or $depth > 2
959 0 18 if int $l != $l
960 0 18 if ($depth == 1)
987 4 0 if ($depth > 1) { }
994 0 12 unless $bc->{$b} <=> $bc->{$a}
1007 0 4 if ($hist != 0)
1010 0 0 if ($depth > 1) { }