Branch Coverage

blib/lib/Mojolicious/Plugin/AdditionalValidationChecks.pm
Criterion Covered Total %
branch 52 52 100.0


line true false branch
25 1 2 $address ? :
30 8 14 defined $nr ? :
35 1 5 unless &looks_like_number($_[2])
36 1 4 unless length $_[3]
41 1 5 unless &looks_like_number($_[2])
42 1 4 unless length $_[3]
47 11 5 if $_[2] =~ m[\A ((?: \+ | 00 ) [1-9]{1}[0-9]{0,2})? # country \s*? [0-9]{2,5} \s*? # local [/-]? \s*? [0-9]{2,12} # phone \z]ux
61 1 2 unless $min or $max
63 3 4 if $min and $length < $min
64 1 3 if $max and $length > $max
71 3 4 unless $url->is_abs
72 1 3 unless grep {$url->scheme eq $_;} 'http', 'https'
78 1 4 unless @_
83 2 2 if ($validation->has_error($field))
143 1 82 unless $types->{$type}
161 10 37 unless $regex
227 14 47 unless $regex
233 3 9 &looks_like_number($_[3]) && &looks_like_number($_[4]) ? :
236 3 9 if ($op eq 'n') { }
252 3 16 unless &looks_like_number($tmp[1])
257 4 12 unless $validation->has_error($field)
264 10 2 unless $validation->has_error($field)
272 1 21 unless $_[2]
273 8 13 unless $_[2] =~ /\A[0-9]{4}-[0-9]{2}-[0-9]{2}\z/u
276 2 11 unless eval { do { $date = 'Time::Piece'->strptime($_[2], '%Y-%m-%d'); 1 } }
282 5 6 if $_[2] ne $date->ymd