Branch Coverage

blib/lib/Config/Validate.pm
Criterion Covered Total %
branch 124 126 98.4


line true false branch
80 17 76 unless (defined $have_data_path)
82 0 17 $@ eq '' ? :
85 1 92 if ($self->data_path and not $have_data_path)
118 9 1 if (@_)
119 1 8 if blessed($_[0])
120 5 4 if $_[0] eq 'Config::Validate'
124 1 8 if ($self)
128 1 8 if (defined $types{$p{'name'}})
134 1 7 if (keys %$type == 0)
147 1 6 if (defined $types[$$self]{$p{'name'}})
153 1 5 if (keys %$type == 0)
169 5 2062 if (defined $$value{$callback})
184 2 112 if (@args < 2)
189 67 45 if (blessed($args[0])) { }
192 65 2 if (@args == 1) { }
200 44 1 if (@args == 2)
228 1 111 if ($config_type =~ /^Config::General/xi)
236 0 74 if ($self->data_path)
255 11 109 unless defined $$cfg{$name}
257 3 106 if ($name ne $canonical_name)
264 1 108 if (lc $$def{'type'} eq 'nested') { }
270 2 77 if (defined $$def{'callback'})
271 1 1 if (ref $$def{'callback'} ne 'CODE')
280 2 82 if (not $found and defined $$def{'default'})
287 3 1 unless ($found or defined $$def{'optional'} and $$def{'optional'})
293 1 77 if (@unknown != 0)
307 1 107 unless (defined $callback)
311 7 100 if ($$typeinfo{'byreference'}) { }
324 4 114 if (defined $$definition{'alias'})
325 2 2 if (ref $$definition{'alias'} eq 'ARRAY') { }
1 1 elsif (ref $$definition{'alias'} eq '') { }
341 1 116 unless (defined $$definition{'type'})
345 1 115 unless (defined $types[$$self]{$$definition{'type'}})
355 26 132 if ref $_[0] eq 'ARRAY'
363 1 4 unless (defined $$def{'keytype'})
367 1 3 unless (defined $types[$$self]{$$def{'keytype'}})
371 1 2 if (ref $value ne 'HASH')
381 2 2 if ($$def{'child'})
391 1 6 unless (defined $$def{'subtype'})
395 1 5 unless (defined $types[$$self]{$$def{'subtype'}})
399 1 4 if (ref $value eq 'SCALAR' and $array_allows_scalar[$$self]) { }
2 3 elsif (ref $value eq 'REF' and ref $$value eq 'ARRAY') { }
406 2 3 if (ref $value ne 'ARRAY')
424 1 12 unless ($value =~ /^ -? \d+ $/ox)
428 1 11 if (defined $$def{'max'} and $value > $$def{'max'})
432 1 10 if (defined $$def{'min'} and $value < $$def{'min'})
442 1 5 unless ($value =~ /^ -? \d*\.?\d+ $/ox)
446 1 4 if (defined $$def{'max'} and $value > $$def{'max'})
450 1 3 if (defined $$def{'min'} and $value < $$def{'min'})
461 3 15 if (defined $$def{'maxlen'})
462 1 2 if (length $value > $$def{'maxlen'})
467 2 15 if (defined $$def{'minlen'})
468 1 1 if (length $value < $$def{'minlen'})
473 4 12 if (defined $$def{'regex'})
474 2 2 unless ($value =~ /$$def{'regex'}/)
489 17 30 if any sub { lc $value eq $_; } , @true
490 10 37 if any sub { lc $value eq $_; } , @false
492 6 41 unless ($value =~ /^ [01] $/x)
503 1 1 unless (-d $value)
512 1 2 unless (-f $value)
527 2 4 unless ($rc)
543 2 4 unless ($rc)
554 116 5 unless $debug[$$self]