Branch Coverage

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


line true false branch
45 1 129 unless defined $$rules{'fields'}
48 128 128 unless exists $$rules{$_}
49 4 124 if (ref $$rules{$_} ne 'ARRAY' or @{$$rules{$_};} % 2)
55 1 248 unless /^(fields|filters|checks)$/
59 121 2 @{$$rules{'fields'};} ? :
64 152 66 if exists $$input{$key}
71 47 169 if $err
75 44 77 keys %$error ? :
86 151 28 if ($ref eq 'CODE') { }
26 2 elsif ($ref eq 'ARRAY') { }
88 56 95 unless defined $param
93 19 20 if (defined $param) { }
94 9 10 if $result
113 140 98 if (_match($key, $match))
114 92 48 $check ? :
115 91 47 if ($check) { }
116 47 44 if $temp
123 169 151 $check ? :
128 220 35 if (not ref $b) { }
22 13 elsif (ref $b eq 'ARRAY') { }
12 1 elsif (ref $b eq 'Regexp') { }
145 25 1 if (exists $FILTERS{$_}) { }
152 17 4 @result == 1 ? :
157 17 20 defined $_[0] && $_[0] ne '' ? :
162 0 3 unless defined $condition
164 0 3 if (ref $condition and ref $condition ne 'CODE')
169 3 4 ref $condition eq 'CODE' ? :
173 3 4 unless $required
174 2 2 defined $value && $value ne '' ? :
182 1 3 if not defined $_[0] or $_[0] eq ''
183 1 2 defined $_[1]{$other} && $_[0] eq $_[1]{$other} ? :
193 1 5 if not defined $_[0] or $_[0] eq ''
194 2 3 length $_[0] >= $min && length $_[0] <= $max ? :
204 1 3 if not defined $_[0] or $_[0] eq ''
205 1 2 length $_[0] >= $length ? :
213 1 4 if not defined $_[0] or $_[0] eq ''
214 2 2 length $_[0] <= $length ? :
222 1 4 if not defined $_[0] or $_[0] eq ''
223 1 3 ref $_[0] eq $class ? :
230 1 2 unless ref $regexp eq 'Regexp'
232 1 4 if not defined $_[0] or $_[0] eq ''
233 1 3 $_[0] =~ /$regexp/ ? :
240 1 2 unless ref $arrayref eq 'ARRAY'
242 1 4 if not defined $_[0] or $_[0] eq ''
243 1 3 _match($_[0], $arrayref) ? :
250 1 5 if (defined $filters and ref $filters eq 'HASH')
252 1 0 if ref $$filters{$key} eq 'CODE'
260 5 1 unless ref $self
262 2 4 if (ref $input ne 'HASH' or ref $rules ne 'HASH')
276 27 0 $AUTOLOAD =~ /::(\w+)$/ ? :
277 0 27 if ($sub =~ /(params|rules)/) { }
21 6 elsif ($sub =~ /(data|error)/) { }
3 3 elsif ($sub eq 'success') { }
2 1 elsif ($sub eq 'to_hash') { }
281 8 13 if (my $field = shift()) { }
283 6 2 if (scalar @$fields)
284 3 3 unless _match($field, $fields)