Branch Coverage

lib/Template/Provider.pm
Criterion Covered Total %
branch 157 246 63.8


line true false branch
88 0 92 if ($] < 5.006)
127 1216 233 if (ref $name) { }
31 202 elsif ('File::Spec'->file_name_is_absolute($name)) { }
7 195 elsif ($name =~ /$RELATIVE_PATH/o) { }
130 1216 0 unless $error
133 1215 1 unless $error
140 2 2 $self->{'TOLERANT'} ? :
27 4 $self->{'ABSOLUTE'} ? :
149 2 2 $self->{'TOLERANT'} ? :
3 4 $self->{'RELATIVE'} ? :
156 195 0 $self->{'INCLUDE_PATH'} ? :
196 3 14 if ('File::Spec'->file_name_is_absolute($name)) { }
2 12 elsif ($name =~ /$RELATIVE_PATH/o) { }
199 2 1 unless $self->{'ABSOLUTE'}
204 1 1 unless $self->{'RELATIVE'}
215 10 3 if $self->_template_modified($path)
222 12 5 if defined $path and not $error
225 3 14 if ($error) { }
2 12 elsif (not defined $path) { }
227 1 2 $self->{'TOLERANT'} ? :
250 0 0 if $path
276 46 362 if (ref $dir eq 'CODE') { }
5 357 elsif (ref $dir and UNIVERSAL::can($dir, 'paths')) { }
278 0 46 if ($@)
295 1 209 if @ipaths
349 160 0 unless (defined $dlim)
350 0 160 $^O eq 'MSWin32' ? :
354 152 8 unless ref $path eq 'ARRAY'
359 0 0 if defined $size and $size == 1 || $size < 0
362 17 143 if (defined($debug = $params->{'DEBUG'})) { }
370 0 160 if ($self->{'DEBUG'})
372 0 0 defined $size ? :
379 7 153 if ($cdir)
382 0 7 if ref $dir
384 0 7 if $^O eq 'MSWin32'
388 2 5 unless -d $wdir
413 0 160 defined $params->{'UNICODE'} ? :
434 0 326 if $self->{'DEBUG'}
437 78 248 if (my $slot = $self->{'LOOKUP'}{$name})
441 1 77 $error ? :
447 56 192 if (my $last_stat_time = $self->{'NOTFOUND'}{$name})
449 56 0 if ($expires_in > 0) { }
451 0 56 if $self->{'DEBUG'}
460 15 177 if ($self->_compiled_is_current($name))
465 15 0 if $compiled_template
475 87 90 if ($error)
484 1 89 if ($error) { }
507 0 198 if $self->{'DEBUG'}
511 0 198 if (my $slot = $self->{'LOOKUP'}{$name})
515 0 0 $error ? :
527 0 296 if $self->{'DEBUG'}
532 155 141 if not $error or $error == 255
539 3 39 if defined $self->{'DEFAULT'} and $name ne $self->{'DEFAULT'}
551 231 66 unless $compext or $compdir
554 0 66 unless $path =~ /^(.+)$/s
555 0 66 if $^O eq 'MSWin32'
558 42 24 if length $compdir
572 0 15 $@ ? :
598 10 1385 unless defined $alias or ref $name
601 0 0 defined $alias ? :
0 1395 if $self->{'DEBUG'}
604 1214 181 if (ref $name eq 'SCALAR')
607 0 1214 defined $alias ? :
0 1214 defined $alias ? :
616 2 179 if (ref $name)
619 2 0 if $self->{'UNICODE'}
621 0 2 defined $alias ? :
0 2 defined $alias ? :
630 93 86 if ($self->_template_modified($name))
632 92 1 unless ($error)
633 92 0 if $self->{'UNICODE'}
643 1 0 unless $tolerant
668 0 0 defined $_ ? :
669 0 78 if $self->{'DEBUG'}
677 2 76 if ($expires_in_sec <= 0) { }
0 76 elsif ($self->{'DEBUG'}) { }
685 2 0 if (not defined $template_mtime or $template_mtime != $slot->[3])
687 0 2 if $self->{'DEBUG'}
690 2 0 unless $error
693 1 1 if ($error) { }
712 47 31 unless ($self->{'HEAD'} == $slot)
714 47 0 if ($slot->[0]) { }
720 18 29 if ($slot->[4]) { }
729 47 0 if $head
760 0 104 if defined $size and not $size
764 0 104 if $self->{'DEBUG'}
769 0 104 if (defined $size and $self->{'SLOTS'} >= $size) { }
771 0 0 if $self->{'DEBUG'}
783 0 0 if $head
793 0 104 if $self->{'DEBUG'}
798 59 45 if $head
800 45 59 unless $self->{'TAIL'}
834 0 0 defined $compfile ? :
0 1308 if $self->{'DEBUG'}
844 1305 3 if ($parsedoc = $parser->parse($text, $data)) { }
853 17 1288 if ($compfile)
858 6 11 unless (-d $basedir)
860 0 6 if $@
864 17 0 unless ($error)
866 0 17 unless $docclass->write_perl_file($compfile, $parsedoc)
874 17 0 if (not defined $error and defined $data->{'time'})
875 0 17 unless (my($cfile) = $compfile =~ /^(.+)$/s)
881 0 17 unless ($ctime or $ctime eq 0)
888 0 17 if $self->{'DEBUG'}
892 1305 0 unless ($error)
894 1305 0 if $data->{'data'} = $DOCUMENT->new($parsedoc)
905 0 3 $self->{'TOLERANT'} ? :
956 0 105 unless $path
964 1 104 if (-d $path) { }
104 0 elsif (open FH, "< $path") { }
979 105 0 wantarray ? :
998 0 104 $time ? :
1014 0 0 $parser ? :
1016 0 0 unless defined $size
1037 0 0 defined $_ ? :
1038 0 0 defined $lookup->{$_} ? :
1060 0 0 if ($node = $self->{'HEAD'})
1072 0 0 $prev ? :
1073 0 0 $next ? :
1090 0 94 unless defined $string
1095 0 94 if &Encode::is_utf8($string)
1107 5 455 if ($bom eq substr($string, 0, length $bom))
1114 0 89 $self->{'ENCODING'} ? :