Branch Coverage

blib/lib/TUWF/Validate.pm
Criterion Covered Total %
branch 116 120 96.6


line true false branch
28 4 84 ref $_[0] eq 'ARRAY' ? :
6 88 ref $_[0] eq 'HASH' ? :
29 78 16 (!defined($min) || $got >= $min) && (!defined($max) || $got <= $max) ? :
36 64 64 $_[0] =~ /$reg/ ? :
122 47 970 if $schema->{'keys'}
125 1372 572 if ($builtin{$_} or /^_analyze_/)
131 2 570 unless $t
132 2 568 if $rec < 1
133 382 186 ref $t eq 'HASH' ? :
142 2 105 if ($top{'type'} and $t->{'schema'}{'type'} and $top{'type'} ne $t->{'schema'}{'type'})
143 2 0 if $schema->{'type'}
150 16 422 if $t->{'schema'}{'keys'}
154 47 836 if $top{'keys'}
155 11 871 if $top{'values'}
177 0 449 if ref $schema eq "TUWF::Validate"
186 10 432 if (exists $c->{'schema'}{'sort'})
192 6 0 $s eq 'num' ? :
2 6 $s eq 'str' ? :
2 8 ref $s eq 'CODE' ? :
194 4 8 if $c->{'schema'}{'unique'} and not ref $c->{'schema'}{'unique'} and not $c->{'schema'}{'sort'}
204 32 628 if ($c->{'schema'}{'keys'})
212 14 2 unless exists $input->{$k} or $s->{'schema'}{'required'} or exists $s->{'schema'}{'default'}
216 8 22 if ($r->[1])
221 8 24 if @err
225 10 642 if ($c->{'schema'}{'values'})
230 2 16 if ($r->[1])
235 2 8 if @err
248 104 20 $r->[1]{'validation'} eq 'func' && (!exists $r->[1]{'result'} || keys %{$$r[1];} > 2) ? :
124 220 if $r->[1]
252 306 220 if ($c->{'schema'}{'func'})
254 104 202 if ref $r eq "HASH"
255 2 200 unless $r
265 156 44 if $c->{'schema'}{'type'} ne "array"
267 10 34 if $c->{'schema'}{'sort'}
270 8 36 if ($c->{'schema'}{'unique'} and ref $c->{'schema'}{'unique'} eq 'CODE') { }
4 32 elsif ($c->{'schema'}{'unique'}) { }
274 4 20 if exists $h{$k}
282 2 6 if $c->{'schema'}{'sort'}->($input->[$i], $$input[$i + 1]) == 0
294 212 8 if (defined $input and not ref $input and $c->{'schema'}{'type'} eq "scalar" and $c->{'schema'}{'rmwhitespace'})
301 44 329 if (not defined $input or not ref $input and $input eq "")
303 12 4 exists $c->{'schema'}{'default'} ? :
6 16 ref $c->{'schema'}{'default'} eq 'CODE' ? :
22 22 unless $c->{'schema'}{'required'}
307 210 119 if ($c->{'schema'}{'type'} eq 'scalar') { }
46 73 elsif ($c->{'schema'}{'type'} eq 'hash') { }
50 23 elsif ($c->{'schema'}{'type'} eq 'array') { }
22 1 elsif ($c->{'schema'}{'type'} eq 'any') { }
308 2 208 if ref $input
311 6 40 if ref $input ne "HASH"
317 20 20 if ($c->{'schema'}{'unknown'} eq 'remove') { }
4 16 elsif ($c->{'schema'}{'unknown'} eq 'reject') { }
321 2 2 if @err
328 2 48 if $c->{'schema'}{'scalar'} and not ref $input
329 0 2 $c->{'schema'}{'scalar'} ? :
2 48 if ref $input ne "ARRAY"
340 116 200 if $r->[1]
350 2 6 ref $c->{'schema'}{'onerror'} eq 'CODE' ? :
8 364 $r->[1] && exists $c->{'schema'}{'onerror'} ? :
355 162 163 ref $_[0] eq 'TUWF::Validate' ? :
383 69 93 if ($_[0][1])