Branch Coverage

blib/lib/Text/Caml.pm
Criterion Covered Total %
branch 105 122 86.0


line true false branch
37 13 6 unless $self->templates_path
49 71 13 ref $_[0] eq 'HASH' ? :
57 0 5 ref $_[0] eq 'HASH' ? :
73 167 77 if ($template =~ /($LEADING_SPACE)?\G $START_TAG /cgmsx) { }
28 49 elsif ($template =~ /\G (.*?) (?=$START_TAG\{?)/cgmsx) { }
79 2 165 if ($template =~ /\G \{ (.*?) \} $END_TAG/cgmsx) { }
1 164 elsif ($template =~ /\G - (.*?) $END_TAG/cgmsx) { }
5 159 elsif ($template =~ /\G ! .*? $END_TAG/cgmsx) { }
47 112 elsif ($template =~ /\G $START_OF_SECTION \s* (.*?) \s* $END_TAG ($TRAILING_SPACE)?/cgmsx) { }
12 100 elsif ($template =~ /\G $START_OF_INVERTED_SECTION (.*?) $END_TAG ($TRAILING_SPACE)?/cgmsx) { }
0 100 elsif ($template =~ /\G $END_OF_SECTION (.*?) $END_TAG/cgmsx) { }
8 92 elsif ($template =~ /\G $START_OF_PARTIAL \s* (.*?) \s* $END_TAG/cgmsx) { }
6 86 elsif ($template =~ /\G $START_OF_TEMPLATE_INHERITANCE \s* (.*?) \s* $END_TAG/cgmsx) { }
5 81 elsif ($template =~ /\G $START_OF_BLOCK \s* (.*?) \s* $END_TAG/cgmsx) { }
81 0 elsif ($template =~ /\G (.*?) $END_TAG/cgmsx) { }
100 47 0 if ($template =~ /\G (.*?) ($LEADING_SPACE)? $START_TAG $END_OF_SECTION $end_of_section $END_TAG ($TRAILING_SPACE)?/cgmsx) { }
118 12 0 if ($template =~ / \G (.*?) ($LEADING_SPACE)? $START_TAG $END_OF_SECTION $name $END_TAG ($TRAILING_SPACE)?/cgmsx) { }
146 6 0 if ($template =~ /\G (.*?) ($LEADING_SPACE)? $START_TAG $END_OF_TEMPLATE_INHERITANCE $end_of_inherited_template $END_TAG ($TRAILING_SPACE)?/cgmsx) { }
162 5 0 if ($template =~ /\G (.*?) ($LEADING_SPACE)? $START_TAG $END_OF_BLOCK $end_of_block $END_TAG/cgmsx) { }
181 139 28 if ($chunk ne '') { }
23 5 elsif ($output eq '' or $leading_newline) { }
185 23 0 if ($template =~ /\G $TRAILING_SPACE/cgmsx)
214 20 63 if ($name eq '.') { }
215 0 20 if $self->_is_empty($context, $name)
224 5 78 if (ref $value eq 'CODE')
226 1 4 unless defined $content
242 3 0 if (ref $value eq 'HASH' and exists $value->{'_with'} and &Scalar::Util::blessed($value->{'_with'}) and $value->{'_with'}->can($part))
251 2 128 if (ref $value eq 'ARRAY')
256 2 17 if (exists $value->{'.'} and &Scalar::Util::blessed($value->{'.'}) and $value->{'.'}->can($part))
264 18 108 if $self->_is_empty($value, $part)
266 2 106 &Scalar::Util::blessed($value) ? :
276 3 107 if ($name eq '.')
277 0 3 if $self->_is_empty($context, $name)
283 95 12 $value ? :
291 3 78 if ($tag =~ s/\A \&//msx)
297 78 3 unless $do_not_escape
310 2 45 if (ref $value eq 'HASH') { }
19 26 elsif (ref $value eq 'ARRAY') { }
4 22 elsif (ref $value eq 'CODE') { }
3 19 elsif (ref $value) { }
12 7 elsif ($value) { }
316 7 31 ref $el eq 'HASH' ? :
350 6 6 unless defined $value
356 0 6 if (ref $value eq 'HASH') { }
2 4 elsif (ref $value eq 'ARRAY') { }
0 4 elsif (not $value) { }
359 1 1 if @$value
374 1 7 if (my $ext = $self->{'default_partial_extension'})
379 1 7 if ($template =~ s/^\&//)
385 7 1 $parse ? :
392 0 6 if (my $ext = $self->{'default_partial_extension'})
409 3 2 if ($override =~ / $START_OF_BLOCK \s* $name \s* $END_TAG/cgmsx)
411 3 0 if ($override =~ / (.*) $START_TAG $END_OF_BLOCK \s* $name \s* $END_TAG/cgmsx) { }
426 18 1 defined $self->templates_path && !'File::Spec'->file_name_is_absolute($template) ? :
432 1 18 unless defined $path and -f $path
436 0 18 unless open my $file, '<:encoding(UTF-8)', $path
440 0 18 unless defined $content
453 3 146 if (&Scalar::Util::blessed($vars)) { }
457 4 142 unless exists $vars->{$name}
461 2 143 unless defined $var
462 12 131 if $var eq ''