Branch Coverage

blib/lib/Yancy/Backend/Static.pm
Criterion Covered Total %
branch 42 58 72.4


line true false branch
218 2 11 if ($id =~ m[/$] and -d $self->path->child($id)) { }
229 2 11 unless -f $path
232 0 11 if ($@)
248 4 18 unless $path =~ /[.](?:markdown|md)$/
250 0 18 if ($@)
255 2 16 unless match($params, $item)
264 3 5 $opt->{'limit'} ? :
265 1 7 if ($end > $#items)
281 2 1 -f $path ? :
285 2 1 if ($params->{'path'})
287 1 1 if (-f $path and $new_path ne $path)
330 0 1 @schemas ? :
336 2 8 if ($id =~ m[(?:^|\/)index$]) { }
0 8 elsif ($id =~ /\.\w+$/) { }
359 0 31 unless open my $fh, '<', $path
366 0 6 unless (-d $path->dirname)
370 0 6 unless open my $fh, '>', $path
391 28 3 if (@lines and $lines[0] =~ /^---/) { }
3 0 elsif (@lines and $lines[0] =~ /^{/) { }
397 0 28 unless (defined $i)
408 13 26 if $v and $v eq 'false'
409 0 39 if $v and $v eq 'true'
413 0 28 if ($@)
423 3 0 if ($lines[0] =~ /\}$/) { }
431 0 0 unless (defined $i)
439 0 3 if ($@)
456 0 2 $v ? :
2 5 JSON::PP::is_bool($v) ? :
460 5 1 %data ? :