Branch Coverage

blib/lib/App/Spec/Run/Validator.pm
Criterion Covered Total %
branch 69 86 80.2


line true false branch
43 27 17 if ($args{'type'} eq 'parameters') { }
59 43 67 if ($spec->type eq 'flag')
60 16 27 if ($spec->multiple) { }
61 0 16 if (defined $value and not $value =~ /^\d+$/)
66 0 27 if (defined $value and $value != 1)
74 5 62 if ($spec->multiple and $spec->mapping) { }
10 52 elsif ($spec->multiple) { }
75 0 5 unless (defined $value)
80 0 5 unless (keys %$values)
81 0 0 if (defined(my $default = $spec->default))
87 0 5 if (not keys %$values and $spec->required)
92 0 5 unless (keys %$values)
98 0 10 unless (defined $value)
103 6 4 unless (@$values)
104 0 6 if (defined(my $default = $spec->default))
110 6 4 if (not @$values and $spec->required)
115 0 4 unless (@$values)
119 1 3 if ($spec->unique and &uniq(@$values) != @$values)
127 25 27 unless (defined $value)
128 0 25 if (defined(my $default = $spec->default))
134 4 48 if (not defined $value and $spec->required)
139 21 27 unless (defined $value)
147 0 35 if (ref $param_type eq 'HASH')
150 0 35 unless my $code = $validate{$param_type}
153 5 30 $spec->mapping ? :
154 22 13 if (my $spec_values = $spec->values)
155 17 5 if (my $op = $spec_values->{'op'}) { }
5 0 elsif ($spec->mapping) { }
171 5 30 $spec->mapping ? :
175 6 31 if ($spec->mapping) { }
183 3 34 unless ($ok)
187 7 30 if ($enum)
189 0 7 unless my $code = $validate{'enum'}
191 1 6 unless ($ok)
195 0 37 if ($param_type eq 'file' and $v eq '-')
201 6 31 if ($spec->mapping and keys %$possible_values) { }
15 16 elsif (@$possible_values) { }
203 3 3 if (exists $possible_values->{$key})
204 2 1 if (my $list = $possible_values->{$key}) { }
212 3 3 unless ($ok)
218 13 14 XXX ? :
220 2 13 unless ($ok)
226 14 30 keys %$errs ? :