Branch Coverage

lib/Mojolicious/Plugin/InputValidation.pm
Criterion Covered Total %
branch 45 58 77.5


line true false branch
6 35 35 if @_
9 0 18 if @_
14 3 3 if $self->nillable and not defined $value or $self->empty and defined $value and not ref $value and $value eq '' or defined $value and not $self->pattern or $self->pattern and $value =~ $self->pattern
28 4 2 if $self->nillable and not defined $value or $self->empty and defined $value and not ref $value and $value eq '' or $value =~ /^\w+$/
41 2 2 if $self->nillable and not defined $value or $self->empty and defined $value and not ref $value and $value eq '' or $value =~ /^-?\d+\.\d+$/
54 9 2 if $self->nillable and not defined $value or $self->empty and defined $value and not ref $value and $value eq '' or $value =~ /^-?\d+$/
67 5 2 if $self->nillable and not defined $value or $self->empty and defined $value and not ref $value and $value eq '' or ref($value) =~ /^JSON::PP::Boolean$/
84 1 4 if (ref $elem eq 'ARRAY') { }
97 0 4 if $self->nillable and not defined $value
99 0 4 unless (ref $value eq 'ARRAY')
106 0 4 if (defined $self->{'max'} and $elems > $self->{'max'})
112 0 4 if (defined $self->{'min'} and $elems < $self->{'min'})
118 3 1 if ($self->{'of'}) { }
1 0 elsif ($self->{'pattern'} and not $self->{'min'} and not $self->{'min'}) { }
122 2 5 if ($err)
132 0 1 if ($err)
154 40 0 if (ref $elem eq 'HASH') { }
167 0 40 if $self->nillable and not defined $value
169 0 40 unless (ref $value eq 'HASH')
181 1 39 if (@unexpected)
186 1 38 if (@missing)
194 19 31 if ($err)
208 0 3 if @_
209 3 0 unless $self->{'pattern'}
213 2 1 if $self->nillable and not defined $value or $self->empty and defined $value and not ref $value and $value eq '' or $value =~ $self->pattern
270 40 44 if (ref $pattern eq 'HASH') { }
1 43 elsif (ref $pattern eq 'ARRAY') { }
277 0 84 unless UNIVERSAL::isa($pattern, 'IV_ANY')
280 35 49 unless $pattern->accepts($input, $path // '')