Branch Coverage

blib/lib/Data/Radius/Encode.pm
Criterion Covered Total %
branch 49 92 53.2


line true false branch
41 0 15 if $RaiseError
42 15 0 if $PrintError
78 5 12 $attr && $attr->{'vendor'} ? :
79 2 15 if (length $value > $max_size)
89 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) { }
105 0 1 $attr && $attr->{'vendor'} ? :
106 0 1 if (length $value > $max_size)
116 1 19 unless ($value =~ /^-?\d+$/)
120 19 0 if ($range)
121 8 11 if ($value < $range->[0] or $value > $range->[1])
129 4 3 check_numeric($_[0], $_[1], [0, 4294967295]) ? :
130 2 2 check_numeric($_[0], $_[1], [0, 255]) ? :
131 1 2 check_numeric($_[0], $_[1], [0, 65535]) ? :
132 2 2 check_numeric($_[0], $_[1], [-2147483648.0, 2147483647]) ? :
136 0 2 unless check_numeric($value, $attr, [0, 16777215])
138 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) { }
163 0 0 unless $expanded_value
165 0 0 unless defined $bin_value
172 1 1 unless ($value =~ /^0x(?:[0-9A-Fa-f]{2})+$/)
184 1 1 if ($ip =~ /^\d+\.\d+.\d+.\d+$/)
193 4 0 if (($attr->{'vendor'} // "") eq "Cisco")
197 2 2 if ($attr->{'id'} == 1 and $attr->{'name'} ne "Cisco-AVPair")
202 2 2 if (length $value > 247)
217 0 3 unless ($attr)
225 0 3 if (($attr->{'parent'} // "") ne $parent->{'name'})
232 1 2 if (is_enum_type($attr->{'type'})) { }
251 0 0 if ($value =~ m[^(\d+\.\d+\.\d+\.\d+)(?:/(\d+))?$]) { }
259 0 0 if ($prefix_len < 0 or $prefix_len > 32)
265 0 0 unless (defined $ip_bin)
277 0 0 if ($value =~ m[^([0-9a-fA-F:]+)(?:/(\d+))?$]) { }
285 0 0 if ($prefix_len < 0 or $prefix_len > 128)
291 0 0 unless (defined $ip_bin)
303 0 0 if ($value =~ m[^([0-9a-fA-F:]+)(?:/(\d+))?$]) { }
311 0 0 if ($prefix_len < 0 or $prefix_len > 128)
317 0 0 unless ($expanded_value)
323 0 0 unless (defined $bin_value)
335 1 52 unless (defined $value)
342 3 49 if ($attr->{'has_tag'}) { }
347 0 49 if defined $tag
350 52 0 if ($encoder_sub = $encode_map{$encoder_type}) { }