Branch Coverage

blib/lib/Yancy/Backend/Static.pm
Criterion Covered Total %
branch 47 64 73.4


line true false branch
218 2 11 if ($id =~ m[/$]u and -d $self->path->child($id)) { }
229 2 11 unless -f $path
232 0 11 if ($@)
243 20 9 unless my $schema = $self->schema->{$schema_name}
245 2 34 unless my $prop = $schema->{'properties'}{$prop_name}
246 0 34 if ($prop->{'type'} eq 'array' and ref $item->{$prop_name} ne 'ARRAY')
260 4 18 unless $path =~ /[.](?:markdown|md)$/u
262 0 18 if ($@)
268 2 16 unless match($params, $item)
277 3 5 $opt->{'limit'} ? :
278 1 7 if ($end > $#items)
294 2 1 -f $path ? :
298 2 1 if ($params->{'slug'})
300 1 1 if (-f $path and $new_path ne $path)
343 0 1 @schemas ? :
349 2 8 if ($id =~ m[(?:^|\/)index$]u) { }
0 8 elsif ($id =~ /\.\w+$/u) { }
372 0 31 unless open my $fh, '<', $path
379 0 6 unless (-d $path->dirname)
383 0 6 unless open my $fh, '>', $path
404 28 3 if (@lines and $lines[0] =~ /^---/u) { }
3 0 elsif (@lines and $lines[0] =~ /^{/u) { }
410 0 28 unless (defined $i)
421 13 26 if $v and $v eq 'false'
422 0 39 if $v and $v eq 'true'
426 0 28 if ($@)
436 3 0 if ($lines[0] =~ /\}$/u) { }
444 0 0 unless (defined $i)
452 0 3 if ($@)
469 0 2 $v ? :
2 5 JSON::PP::is_bool($v) ? :
473 5 1 %data ? :