Branch Coverage

blib/lib/TUWF/Misc.pm
Criterion Covered Total %
branch 55 64 85.9


line true false branch
30 4 9 if defined $_[1]{'min'} and $_[0] < $_[1]{'min'}
31 3 6 if defined $_[1]{'max'} and $_[0] > $_[1]{'max'}
68 81 11 unless $f->{'multi'}
73 52 45 if not $errfield or $errfield eq 'default'
77 11 81 $f->{'multi'} ? :
80 2 90 if $f->{'mincount'} and @values < $f->{'mincount'}
81 2 90 if $f->{'maxcount'} and @values > $f->{'maxcount'}
84 49 43 if @err
91 517 379 unless $rules->{'template'}
93 17 362 if (exists $tpl->{$field}) { }
107 86 11 unless exists $r->{'required'}
108 88 9 unless exists $r->{'rmwhitespace'}
111 75 7 if ($v and $r->{'rmwhitespace'})
119 9 88 if (not defined $v or length $v < 1)
120 6 3 if $r->{'required'}
121 2 1 if exists $r->{'default'}
133 0 155 if $r->{'template'} and not $$t{$r->{'template'}}
136 2 153 if $r->{'minlength'} and length $v < $r->{'minlength'}
137 3 150 if $r->{'maxlength'} and length $v > $r->{'maxlength'}
139 1 149 if $r->{'enum'} and not grep(($_ eq $v), @{$$r{'enum'};})
141 1 52 ref $r->{'regex'} eq 'ARRAY' ? :
23 30 if $r->{'regex'} and ref $r->{'regex'} eq 'ARRAY' ? !($v =~ /$r->{'regex'}[0]/i) : !($v =~ /$r->{'regex'}/)
143 67 59 if ($r->{'template'})
145 11 23 exists $r->{$_} ? :
18 49 $in ? :
146 30 37 if _validate($_[0], $t, \%r)
149 1 18 ref $r->{'func'} eq 'ARRAY' ? :
10 9 if $r->{'func'} and ref $r->{'func'} eq 'ARRAY' ? !$r->{'func'}[0]->($_[0], $r) : !$r->{'func'}->($_[0], $r)
178 0 0 unless $hs{'To'}
179 0 0 unless $hs{'Subject'}
191 0 0 if (open my $mailer, '|-:utf8', "$self->{'_TUWF'}{'mail_sendmail'} -t -f '$hs{'From'}'") { }
193 0 0 if not close $mailer