Branch Coverage

blib/lib/Data/Radius/Encode.pm
Criterion Covered Total %
branch 49 72 68.0


line true false branch
41 0 15 if $RaiseError
42 15 0 if $PrintError
75 5 11 $attr && $attr->{'vendor'} ? :
76 2 14 if (length $value > $max_size)
86 0 1 if (not defined $tag) { }
0 1 elsif (not $tag =~ /^\d+$/) { }
0 1 elsif ($tag == 0) { }
0 1 elsif ($tag < 1 or $tag > 31) { }
102 0 1 $attr && $attr->{'vendor'} ? :
103 0 1 if (length $value > $max_size)
113 1 17 unless ($value =~ /^-?\d+$/)
117 17 0 if ($range)
118 8 9 if ($value < $range->[0] or $value > $range->[1])
126 2 3 check_numeric($_[0], $_[1], [0, 4294967295]) ? :
127 2 2 check_numeric($_[0], $_[1], [0, 255]) ? :
128 1 2 check_numeric($_[0], $_[1], [0, 65535]) ? :
129 2 2 check_numeric($_[0], $_[1], [-2147483648, 2147483647]) ? :
133 0 2 unless check_numeric($value, $attr, [0, 16777215])
135 0 2 if (not defined $tag) { }
0 2 elsif (not $tag =~ /^\d+$/) { }
0 2 elsif ($tag == 0) { }
0 2 elsif ($tag < 1 or $tag > 31) { }
160 0 0 unless $expanded_value
162 0 0 unless defined $bin_value
169 1 1 unless ($value =~ /^0x(?:[0-9A-Fa-f]{2})+$/)
181 1 1 if ($ip =~ /^\d+\.\d+.\d+.\d+$/)
190 4 0 if (($attr->{'vendor'} // '') eq 'Cisco')
194 2 2 if ($attr->{'id'} == 1 and $attr->{'name'} ne 'Cisco-AVPair')
199 2 2 if (length $value > 247)
214 0 3 unless ($attr)
222 0 3 if (($attr->{'parent'} // '') ne $parent->{'name'})
229 1 2 if (is_enum_type($attr->{'type'})) { }
248 1 49 unless (defined $value)
255 3 46 if ($attr->{'has_tag'}) { }
260 0 46 if defined $tag
263 49 0 if ($encoder_sub = $encode_map{$encoder_type}) { }