Branch Coverage

blib/lib/FormValidator/Tiny.pm
Criterion Covered Total %
branch 176 194 90.7


line true false branch
59 1 1 $fc_ eq $fcno ? :
1 2 $fc_ eq $fcyes ? :
80 1 55 unless defined $_[0]
91 0 6 unless defined $value
99 2 1 if ($type->can('check')) { }
1 0 elsif ($type->can('validate')) { }
101 1 1 $type->can('get_message') ? :
105 0 4 unless defined $value
113 0 2 unless defined $value
132 50 28 if 'ARRAY' eq ref $stuff
133 27 1 if 'HASH' eq ref $stuff
139 15 15 if 'ARRAY' eq ref $old_stuff
140 15 0 if 'HASH' eq ref $old_stuff
147 2 4 $element eq 'each' ? :
150 2 4 if ($element eq 'key') { }
2 2 elsif ($element eq 'value') { }
171 16 16 unless ($element_valid)
191 0 39 unless $spec_name =~ /$PACKAGE_RE/u
195 1 38 if ($spec_name =~ /\b(::|')\b/u) { }
217 23 17 if (ref $name)
223 17 23 if (defined $name) { }
227 1 22 unless (defined wantarray)
233 1 38 unless 'ARRAY' eq ref $spec
236 1 37 unless scalar @$spec % 2 == 0
246 1 57 if $encountered_fields{$field}
249 1 56 unless 'ARRAY' eq ref $decls
252 1 55 unless scalar @$decls % 2 == 0
260 17 65 if (&any(sub { $op eq $_; } , 'from', 'multiple', 'trim')) { }
24 41 elsif ($op =~ /^ (?: (each|key|value)_ )? into $/ux) { }
6 35 elsif ($op eq 'required' or $op eq 'optional') { }
31 4 elsif ($op =~ /^ (?: (each|key|value)_ )? must $/ux) { }
3 1 elsif ($op eq 'with_error') { }
261 3 14 if @decl > 1
265 3 11 if defined $options{$op}
274 1 23 if ('CODE' eq ref $arg) { }
1 22 elsif (&blessed($arg) and $arg->can('coerce')) { }
14 8 elsif (defined $coercer{$arg}) { }
3 5 elsif ($arg =~ /\?([^!]+)!(.+)/u) { }
1 4 elsif ($arg =~ /$PACKAGE_RE/u) { }
293 0 20 if $element
298 3 3 if $op eq 'optional'
301 3 3 if ($arg) { }
311 8 2 defined $_[0] && $_[0] =~ /./u ? :
321 17 14 if ('CODE' eq ref $arg) { }
6 8 elsif ('Regexp' eq ref $arg) { }
3 5 elsif (&blessed($arg) and $arg->can('check') || $arg->can('validate')) { }
334 6 20 if $element
339 1 2 unless @decl > 1
357 16 1 if (defined $name)
373 0 28 if (&blessed($input) and $input->can('flatten')) { }
381 23 5 unless (&blessed($spec) and $spec->isa('FormValidator::Tiny'))
389 0 23 unless defined $spec
394 0 28 unless defined $spec
402 91 130 if ('HASH' eq ref $decl) { }
408 104 4 if (defined $_)
91 0 if $trim
410 32 59 if ($multiple) { }
421 2 128 if (not defined $valid) { }
97 31 elsif ($valid) { }
439 12 16 scalar keys %errors ? :
444 0 9 if (@_ == 0) { }
5 4 elsif (@_ == 1) { }
2 2 elsif (@_ == 2) { }
462 2 18 if (1 == length $_) { }
13 5 elsif (/^(.)-(.)$/u and ord $1 < ord $2) { }
1 4 elsif (/^\[([^\]]+)\]$/u) { }
486 3 8 if (@_ == 2 and 'ARRAY' eq ref $_[0] and 'ARRAY' eq ref $_[1]) { }
517 2 7 unless $start =~ /^(?:[0-9]+|\*)$/u
520 1 6 unless $stop =~ /^(?:[0-9]+|\*)$/u
523 1 3 if $start ne '*' and $stop ne '*' and $start > $stop
526 1 4 if ($start eq '*' and $stop eq '*') { }
1 3 elsif ($start eq '*') { }
1 2 elsif ($stop eq '*') { }
543 0 5 unless defined $_[0]
544 4 1 if (length $_[0] >= $start) { }
569 1 8 if ($start eq 'exclusive')
575 1 8 if ($stop eq 'exclusive')
580 1 8 unless $start eq '*' or &looks_like_number($start)
583 1 7 unless $stop eq '*' or &looks_like_number($stop)
586 1 4 if $start ne '*' and $stop ne '*' and $start > $stop
590 5 1 $starti ? :
592 5 1 $stopi ? :
594 1 5 if ($start eq '*' and $stop eq '*') { }
1 4 elsif ($start eq '*') { }
2 2 elsif ($stop eq '*') { }
606 2 5 unless $v
615 1 3 unless defined $by
618 1 2 if defined $count and $count <= 1
621 1 1 if ($count) { }
622 1 0 defined $_[0] ? :
625 1 0 defined $_[0] ? :
631 2 3 if ($only eq 'both') { }
1 2 elsif ($only eq 'left') { }
1 1 elsif ($only eq 'right') { }
633 0 2 unless defined $_
640 0 1 unless defined $_
646 0 1 unless defined $_