Branch Coverage

lib/OODoc/Template.pm
Criterion Covered Total %
branch 123 156 78.8


line true false branch
50 30 52 @_ ? :
30 82 @_ == 1 ? :
52 6 105 ref $templ eq 'ARRAY' ? :
1 111 ref $templ eq 'SCALAR' ? :
57 0 112 unless defined $tree
60 54 58 if keys %$values
65 225 113 unless (ref $node)
75 11 6 ref $_ eq 'ARRAY' ? :
77 5 7 @$v == 1 ? :
41 12 ref $v ne 'ARRAY' ? :
84 74 39 unless (defined $then or defined $else)
85 14 60 unless defined $value
88 0 60 unless ref $value ne 'ARRAY' and ref $value ne 'HASH'
99 16 23 $take_else ? :
101 12 27 unless defined $container
104 3 24 if keys %$attrs
106 6 21 if ($take_else) { }
3 18 elsif (ref $value eq 'HASH') { }
11 7 elsif (ref $value eq 'ARRAY') { }
129 3 24 if keys %$attrs
132 54 58 if keys %$values
134 6 2 defined wantarray ? :
104 8 wantarray ? :
143 6 0 @_ == 1 ? :
149 4 2 if (exists $$cache{$filename}) { }
1 1 elsif ($template = $self->loadFile($filename)) { }
151 4 0 if defined $tree
162 0 6 unless defined $tree or defined wantarray
165 6 0 defined wantarray ? :
0 6 wantarray ? :
173 0 1 unless my $name = delete $$attrs{'name'}
176 0 1 if defined $else
200 212 72 if (defined $v)
205 60 119 wantarray ? :
179 33 if ref $v ne 'CODE'
209 29 4 wantarray ? :
213 4 0 wantarray ? :
4 68 if exists $$set{$tag}
217 0 68 if (defined $code)
219 0 0 wantarray ? :
0 0 if defined $value
225 20 0 wantarray ? :
235 2 2 if (defined(my $v = $$set{$tag}))
236 0 2 ref $v eq 'CODE' ? :
237 2 0 if defined $t
240 0 4 if (defined(my $code = $$set{'DYNAMIC'}))
242 0 0 if defined $t
253 14 54 if (my $markers = $$attrs{'markers'})
255 13 1 ref $markers eq 'ARRAY' ? :
257 2 12 if @markers == 2
260 2 12 if @markers == 3
263 8 48 ref $_ eq 'Regexp' ? :
267 11 57 if (my $search = $$attrs{'search'})
268 11 0 if ref $search ne 'ARRAY'
285 0 7 if defined $then or defined $else
288 5 2 if (my $fn = $$attrs{'file'})
290 1 4 if not defined $output and $$attrs{'alt'}
293 0 5 unless defined $output
299 2 0 if (my $name = $$attrs{'macro'})
300 0 2 unless my $macro = $$self{'macros'}{$name}
315 0 2 if ('File::Spec'->file_name_is_absolute($relfn))
317 0 0 if -f $fn
320 2 0 unless ($absfn)
324 1 2 if -f $absfn
329 1 1 unless defined $absfn
333 0 1 unless (defined $in)
351 0 106 unless defined $template
377 40 69 if ($template =~ s/ (.*?) # contained ( $$markers[2] \s* \Q$tag\E \s* # "our" tag $$markers[3] ) //sx)
387 5 104 if ($not) { }
69 35 elsif (not defined $then) { }
5 30 elsif ($then =~ s/ $$markers[0] \s* ELSE (?:_|\s+) \Q$tag\E \s* $$markers[1] (.*) //sx) { }
426 11 46 unless (defined $v)
431 11 35 if ($v =~ /^\'(.*)\'$/)
440 23 12 if (@v == 1 and not $v[0] =~ /^\$/)
447 12 24 if (/^ (?: \$(\w+) | \$\{ (\w+) \s* \} ) $/x) { }
4 20 elsif (/^ \$\{ (\w+) \s* ([^\}]+? \s* ) \} $/x) { }
454 6 14 if length $_
461 0 113 if length $string