Branch Coverage

lib/OODoc/Template.pm
Criterion Covered Total %
branch 122 156 78.2


line true false branch
53 30 51 @_ ? :
30 81 @_ == 1 ? :
55 6 104 ref $templ eq 'ARRAY' ? :
1 110 ref $templ eq 'SCALAR' ? :
60 0 111 unless defined $tree
63 54 57 if keys %$values
68 224 113 unless (ref $node)
80 11 6 ref $_ eq 'ARRAY' ? :
5 7 @$v == 1 ? :
41 12 ref $v ne 'ARRAY' ? :
87 74 39 unless (defined $then or defined $else)
88 14 60 unless defined $value
91 0 60 unless ref $value ne "ARRAY" and ref $value ne "HASH"
102 16 23 $take_else ? :
104 12 27 unless defined $container
107 3 24 if keys %$attrs
109 6 21 if ($take_else) { }
3 18 elsif (ref $value eq 'HASH') { }
11 7 elsif (ref $value eq 'ARRAY') { }
132 3 24 if keys %$attrs
135 54 57 if keys %$values
137 6 1 defined wantarray ? :
104 7 wantarray ? :
146 6 0 @_ == 1 ? :
152 4 2 if (exists $cache->{$filename}) { }
1 1 elsif ($template = $self->loadFile($filename)) { }
154 4 0 if defined $tree
165 0 6 unless defined $tree or defined wantarray
168 6 0 defined wantarray ? :
0 6 wantarray ? :
177 0 1 unless my $name = delete $attrs->{'name'}
179 0 1 if defined $else
203 211 72 if (defined $v)
208 60 118 wantarray ? :
178 33 if ref $v ne "CODE"
212 29 4 wantarray ? :
217 4 0 wantarray ? :
4 68 if exists $set->{$tag}
220 0 68 if (defined $code)
222 0 0 wantarray ? :
0 0 if defined $value
228 20 0 wantarray ? :
238 2 2 if (defined(my $v = $set->{$tag}))
239 0 2 ref $v eq 'CODE' ? :
240 2 0 if defined $t
243 0 4 if (defined(my $code = $set->{'DYNAMIC'}))
245 0 0 if defined $t
256 14 54 if (my $markers = $attrs->{'markers'})
258 13 1 ref $markers eq 'ARRAY' ? :
260 2 12 if @markers == 2
263 2 12 if @markers == 3
267 8 48 ref $_ eq 'Regexp' ? :
270 11 57 if (my $search = $attrs->{'search'})
271 11 0 if ref $search ne "ARRAY"
288 0 7 if defined $then or defined $else
291 5 2 if (my $fn = $attrs->{'file'})
294 1 0 if not defined $output and $attrs->{'alt'}
296 0 5 unless defined $output
302 2 0 if (my $name = $attrs->{'macro'})
303 0 2 unless my $macro = $self->{'macros'}{$name}
318 0 2 if ("File::Spec"->file_name_is_absolute($relfn))
320 0 0 if -f $fn
323 2 0 unless ($absfn)
327 1 2 if -f $absfn
332 1 1 unless defined $absfn
336 0 1 unless (defined $in)
354 0 105 unless defined $template
380 40 69 if ($template =~ s/ (.*?) # contained ( $markers->[2] \s* \Q$tag\E \s* # "our" tag $markers->[3] ) //sx)
390 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) { }
429 11 46 unless (defined $v)
434 11 35 if ($v =~ /^\'(.*)\'$/)
443 23 12 if (@v == 1 and not $v[0] =~ /^\$/)
450 12 24 if (/^ (?: \$(\w+) | \$\{ (\w+) \s* \} ) $/x) { }
4 20 elsif (/^ \$\{ (\w+) \s* ([^\}]+? \s* ) \} $/x) { }
457 6 14 if length $_
464 0 113 if length $string