Branch Coverage

lib/HTML/ValidationRules/Legacy.pm
Criterion Covered Total %
branch 53 64 82.8


line true false branch
29 0 17 unless (ref $form)
30 0 0 $charset ? :
39 24 16 if (grep {$_ eq $type;} 'hidden', 'checkbox', 'radio', 'submit', 'image')
43 2 38 if ($tag->tag eq 'select')
49 1 39 if ($type eq 'number')
51 1 0 if (my $val = $tag->attr->{'min'})
54 1 0 if (my $val = $tag->attr->{'max'})
59 33 7 unless (exists $tag->attr->{'disabled'})
60 19 8 if ($type ne 'submit' and $type ne 'image' and $type ne 'checkbox' and $type ne 'radio' || exists $tag->attr->{'checked'})
66 2 38 if (exists $tag->attr->{'maxlength'})
70 2 38 if (exists $tag->attr->{'required'})
74 1 39 if (exists $tag->attr->{'pattern'})
88 0 44 unless (&blessed($params) and $params->isa('Mojo::Parameters'))
91 0 0 if (&blessed($params) and $params->isa('Hash::MultiValue')) { }
101 44 0 unless ($schema->{$TERM_ADD_PROPS})
103 2 67 unless $props->{$name}
110 52 31 if (($props->{$name}{$TERM_REQUIRED} || '') eq 'Mojo::JSON'->true)
111 3 49 unless scalar @params
114 44 36 if (my $allowed = $props->{$name}{$TERM_OPTIONS})
117 7 18 unless grep {$_ eq $given;} @$allowed
120 5 68 if (exists $props->{$name}{$TERM_MAXLENGTH})
123 2 3 if length $given > $props->{$name}{$TERM_MAXLENGTH}
126 2 69 if (defined $props->{$name}{$TERM_MIN_LENGTH})
129 1 1 if length $given < $props->{$name}{$TERM_MIN_LENGTH}
132 5 65 if (my $pattern = $props->{$name}{$TERM_PATTERN})
134 4 1 unless $given =~ /\A$pattern\Z/
138 6 60 if (($props->{$name}{$TERM_TYPE} || '') eq $TERM_NUMBER)
140 1 5 unless $given =~ /\A[\d\+\-\.]+\Z/
142 5 0 if (my $min = $props->{$name}{$TERM_MIN})
143 1 4 if $given < $min
145 4 0 if (my $max = $props->{$name}{$TERM_MAX})
146 2 2 if $given > $max