Branch Coverage

blib/lib/JSON/Schema/Fit.pm
Criterion Covered Total %
branch 52 60 86.6


line true false branch
60 0 19 unless exists $valid_option{$k}
70 19 196 if (@_) { }
81 3 93 if not ref $schema or &reftype($schema) ne 'HASH'
83 6 12 if (exists $schema->{'default'} and !defined($struc) && $self->fill_defaults || $self->replace_invalid_values && !$self->_is_valid($struc, $schema))
93 2 85 unless $method
101 6 1 if (my $enum = $schema->{'enum'})
102 4 2 if &none(sub { my $v = $_; $struc eq $v; } , @$enum)
114 0 9 unless exists $schema->{'default'}
117 0 9 ref $default ? :
124 2 85 unless $type
126 85 0 if $self->can($method)
134 2 11 unless $self->booleans
135 10 1 if $struc
143 2 17 unless $self->numbers
152 2 31 unless $self->numbers
155 29 2 if ($self->round_numbers)
157 19 10 if $quantum
160 17 14 if ($self->clamp_numbers)
161 3 14 if exists $schema->{'maximum'} and $result > $schema->{'maximum'}
162 1 16 if exists $schema->{'minimum'} and $result < $schema->{'minimum'}
172 4 17 unless $self->strings
180 0 1 if &reftype($struc) ne 'ARRAY'
193 0 15 if &reftype($struc) ne 'HASH'
201 10 3 if ($self->hash_keys and exists $schema->{'additionalProperties'} and not $schema->{'additionalProperties'})
210 10 61 if $keys_re and not $key =~ /$keys_re/x
213 0 61 if (my $re_key = !$subschema && &first(sub { $key =~ /$_/x; } , keys %$p_properties))
220 6 9 if ($self->fill_defaults)
222 13 3 if exists $result->{$key}
224 0 3 unless exists $subschema->{'default'}
237 61 3 if $key =~ /^[_A-Za-z]\w*$/x