Branch Coverage

blib/lib/TUWF/Validate.pm
Criterion Covered Total %
branch 109 114 95.6


line true false branch
27 4 84 ref $_[0] eq 'ARRAY' ? :
6 88 ref $_[0] eq 'HASH' ? :
28 78 16 (!defined($min) || $got >= $min) && (!defined($max) || $got <= $max) ? :
35 68 56 $_[0] =~ /$reg/ ? :
120 45 918 if $schema->{'keys'}
123 1306 544 if ($builtin{$_} or /^_analyze_/)
129 2 542 unless $t
130 2 540 if $rec < 1
131 354 186 ref $t eq 'HASH' ? :
140 2 91 if ($top{'type'} and $t->{'schema'}{'type'} and $top{'type'} ne $t->{'schema'}{'type'})
141 2 0 if $schema->{'type'}
147 16 394 if $t->{'schema'}{'keys'}
151 45 784 if $top{'keys'}
152 9 819 if $top{'values'}
174 0 423 if ref $schema eq 'TUWF::Validate'
183 10 406 if (exists $c->{'schema'}{'sort'})
189 6 0 $s eq 'num' ? :
2 6 $s eq 'str' ? :
2 8 ref $s eq 'CODE' ? :
191 4 8 if $c->{'schema'}{'unique'} and not ref $c->{'schema'}{'unique'} and not $c->{'schema'}{'sort'}
201 30 602 if ($c->{'schema'}{'keys'})
209 14 2 unless exists $input->{$k} or $s->{'schema'}{'required'} or exists $s->{'schema'}{'default'}
213 8 20 if ($r->[1])
218 8 22 if @err
222 8 616 if ($c->{'schema'}{'values'})
227 2 14 if ($r->[1])
232 2 6 if @err
245 96 20 $r->[1]{'validation'} eq 'func' && (!exists $r->[1]{'result'} || keys %{$$r[1];} > 2) ? :
116 216 if $r->[1]
249 294 212 if ($c->{'schema'}{'func'})
251 96 198 if ref $r eq 'HASH'
252 2 196 unless $r
262 152 40 if $c->{'schema'}{'type'} ne 'array'
264 10 30 if $c->{'schema'}{'sort'}
267 8 32 if ($c->{'schema'}{'unique'} and ref $c->{'schema'}{'unique'} eq 'CODE') { }
4 28 elsif ($c->{'schema'}{'unique'}) { }
271 4 20 if exists $h{$k}
279 2 6 if $c->{'schema'}{'sort'}->($input->[$i], $$input[$i + 1]) == 0
291 206 8 if (defined $input and not ref $input and $c->{'schema'}{'type'} eq 'scalar' and $c->{'schema'}{'rmwhitespace'})
298 34 313 if (not defined $input or not ref $input and $input eq '')
300 12 4 exists $c->{'schema'}{'default'} ? :
16 18 unless $c->{'schema'}{'required'}
304 206 107 if ($c->{'schema'}{'type'} eq 'scalar') { }
42 65 elsif ($c->{'schema'}{'type'} eq 'hash') { }
46 19 elsif ($c->{'schema'}{'type'} eq 'array') { }
18 1 elsif ($c->{'schema'}{'type'} eq 'any') { }
305 2 204 if ref $input
308 6 36 if ref $input ne 'HASH'
311 18 18 if ($c->{'schema'}{'unknown'} eq 'remove') { }
2 16 elsif ($c->{'schema'}{'unknown'} eq 'reject') { }
315 2 0 if @err
324 2 44 if $c->{'schema'}{'scalar'} and not ref $input
325 0 2 $c->{'schema'}{'scalar'} ? :
2 44 if ref $input ne 'ARRAY'
336 108 192 if $r->[1]
344 151 152 ref $_[0] eq 'TUWF::Validate' ? :
372 67 84 if ($_[0][1])