Branch Coverage

blib/lib/Yancy/Backend/Memory.pm
Criterion Covered Total %
branch 94 106 88.6


line true false branch
28 84 1 if ($url)
30 0 84 if ($path)
40 52 3158 if ($schema)
59 5 111 ref $id_field eq 'ARRAY' ? :
64 58 63 if (not $params->{$id_field} and $self->schema->{$schema_name}{'properties'}{$id_field}{'type'} eq 'integer') { }
46 17 elsif ($params->{$id_field} and $id_field ne 'id' and exists $self->schema->{$schema_name}{'properties'}{'id'}) { }
84 5 111 @id_fields > 1 ? :
93 13 315 ref $id_field eq 'ARRAY' ? :
94 1 11 if @ids > 1 and !ref($id) || keys %$id < @ids
98 3 334 unless defined $id
103 4 277 if (my $join = $opt{'join'})
116 8 13 ref $join eq 'ARRAY' ? :
118 21 8 if (my $join_prop = $schema->{'properties'}{$join}) { }
8 0 elsif (my $join_schema = $self->schema->{$join}) { }
124 2 5 unless (match({$k, $where->{$key}}, $item->{$join}))
141 3 5 if (my($join_prop_name) = grep({($props{$_}{'x-foreign-key'} // '') =~ /^$join_schema_name(\.|$)/u;} keys %props)) { }
5 0 elsif (($join_prop_name) = grep({($join_props->{$_}{'x-foreign-key'} // '') =~ /^$schema_name(\.|$)/u;} keys %$join_props)) { }
147 0 3 if keys %$join_where and not $res->{'total'}
154 0 5 if ($join_prop->{'x-foreign-key'} =~ /\.(.+)$/u) { }
162 1 4 if keys %$join_where and not $res->{'total'}
180 1 630 unless $schema->{'properties'}
181 13 618 if ($join)
182 4 9 ref $join eq 'ARRAY' ? :
190 160 176 @opt % 2 == 0 ? :
192 0 336 unless $schema
196 9 327 ref $id_field eq 'ARRAY' ? :
205 7 329 if ($opt->{'join'})
209 1 335 ref $params eq 'ARRAY' ? :
221 131 205 $opt->{'limit'} ? :
222 58 278 if ($last > $#$matched_rows)
238 4 54 ref $id_field eq 'ARRAY' ? :
239 2 2 if @id_fields > 1 and !ref($id) || keys %$id < @id_fields
243 4 54 ref $id eq 'HASH' ? :
244 34 24 unless ($params->{$id_field})
254 2 0 ref $id eq 'HASH' ? :
255 0 2 unless $store->{$id_part}
261 2 54 ref $id eq 'HASH' ? :
262 10 46 unless $store->{$id_part}
273 0 94 unless $id
275 4 90 ref $id_field eq 'ARRAY' ? :
276 2 2 if @id_fields > 1 and !ref($id) || keys %$id < @id_fields
280 2 0 ref $id eq 'HASH' ? :
283 2 90 ref $id eq 'HASH' ? :
284 22 70 unless $store->{$id_part}
290 0 172 unless $data
294 219 825 unless defined $data->{$key}
296 56 769 if (is_type($type, 'boolean')) { }
70 808 elsif (is_type($type, 'string') and is_format($format, 'date-time')) { }
299 24 32 $data->{$key} && !($data->{$key} =~ /^false$/iu) ? :
303 57 13 if ($data->{$key} eq "now")
316 106 0 %Local::Test::SCHEMA ? :
324 413 2737 if ($p->{'format'} and not $db_formats{$p->{'format'}})
329 7 99 @table_names ? :