Branch Coverage

blib/lib/HTML/CMTemplate.pm
Criterion Covered Total %
branch 135 222 60.8


line true false branch
561 456 488 if @_ == 3
567 0 944 if $_NODE_::AUTOLOAD =~ /DESTROY$/o
569 456 488 if (@_ > 1) { }
600 20 39 if (defined $text and $text ne '')
603 30 29 if ($blk)
606 31 28 if ($tpl)
636 3 3 if ($nextif)
666 2 0 if ($nextif)
732 2 1 if ($default)
1026 8 1 if ($r ne 'ARRAY')
1027 0 8 defined $path ? :
1042 8 1 unless ($nocwd)
1051 0 9 unless ('File::Spec'->file_name_is_absolute($canondir))
1056 0 9 unless (-d $canondir)
1060 9 0 unless ($$rh_used{$canondir})
1162 1 0 if (not $r) { }
0 0 elsif ($r ne 'ARRAY') { }
1181 9 10 if ('File::Spec'->file_name_is_absolute($filename))
1182 0 9 unless -f $filename
1191 10 0 if (-f $curpath)
1196 0 10 unless ($fullpath)
1208 0 9 unless ref $path eq 'ARRAY'
1216 0 2 if ($contents =~ /^".*"$/) { }
2 0 elsif ($contents =~ /^'.*'$/) { }
1234 0 1 if ($$self{'filename'} eq $filename) { }
1 0 elsif ($self->__is_root__) { }
1250 0 972 if ($HTML::CMTemplate::DEBUG)
1252 0 0 unless defined $str
1256 0 0 if (ref $str eq 'ARRAY')
1268 0 0 if ($HTML::CMTemplate::DEBUG_FUNCTION_REF)
1274 0 0 if (ref $str eq 'ARRAY')
1277 0 0 if ($HTML::CMTemplate::DEBUG_FILE_NAME) { }
1287 0 0 if ($HTML::CMTemplate::DEBUG_FILE_NAME)
1365 0 1 $$self{'deftable'}{$defname} ? :
1393 0 1 $self->__root__->{'rawtable'}{$filename} ? :
1413 0 1 $self->__root__->{'parsedtable'}{$filename} ? :
1430 50 0 if $node->type eq 'TPL'
1447 6 46 if ('if' eq $name)
1451 2 44 if ('elif' eq $name)
1455 5 39 if ('else' eq $name)
1459 6 33 if ('endif' eq $name)
1463 3 30 if ('for' eq $name)
1467 3 27 if ('endfor' eq $name)
1471 1 26 if ('while' eq $name)
1475 1 25 if ('endwhile' eq $name)
1479 1 24 if ('def' eq $name)
1483 1 23 if ('enddef' eq $name)
1487 2 21 if ('call' eq $name)
1491 1 20 if ('inc' eq $name)
1495 1 19 if ('rawinc' eq $name)
1499 12 7 if ('echo' eq $name)
1503 2 5 if ('break' eq $name)
1507 1 4 if ('continue' eq $name)
1511 1 3 if ('exec' eq $name)
1515 3 0 if ('comment' eq $name)
1540 0 6 unless ($has_colon)
1545 0 6 unless ($has_contents)
1577 0 2 unless ($has_colon)
1582 0 2 unless ($has_contents)
1603 2 0 if ($node->type eq 'blkIF' or $node->type eq 'blkELIF') { }
1629 0 5 unless ($contents =~ /^(\s*):(\s*)$/s)
1650 3 2 if ($node->type eq 'blkIF' or $node->type eq 'blkELIF') { }
2 0 elsif ($node->type eq 'blkFOR') { }
1700 6 0 if ($type eq 'blkIF') { }
1726 0 3 unless ($contents =~ /^\$?(\w+)\s+in\s+(.*):$/s)
1771 3 0 if ($type eq 'blkFOR') { }
1798 0 1 unless ($contents =~ /^(.*):$/s)
1841 1 0 if ($type eq 'blkWHILE') { }
1864 0 1 unless ($contents =~ /^(\w+)\s*\((.*)\)\s*:$/s)
1922 1 0 if ($type eq 'blkDEF') { }
1934 0 1 if ($self->__exists_def__($defblk->name)) { }
0 1 elsif ($self->__exists_def_global__($defblk->name)) { }
1967 0 2 unless ($contents =~ /^(\w+)\s*\((.*)\)\s*$/s)
1995 0 1 if ($self->__is_included__($filename))
2010 1 0 unless ($self->__exists_parsed__($filename))
2041 0 1 if ($self->__exists_raw__($filename)) { }
2174 3 65 $$self{'parserintag'} ? :
2184 55 68 if ($$self{'parserintag'}) { }
2191 52 3 if ($pos > -1) { }
2196 38 14 if ($tag =~ /^(\w+)(\s+(.*?)\s*)?$/s) { }
5 9 elsif ($tag =~ /^(\w+)\s*:\s*$/s) { }
2201 23 15 defined $3 ? :
2226 49 3 if substr($$self{'strbuf'}, $curpos, 1) eq "\n"
2257 52 16 if ($pos > -1) { }
2261 3 49 if ($pos > $curpos)
2284 0 16 $fpos > -1 ? :
2299 65 3 if ($$self{'bufstart'} > 0)
2301 65 0 if ($$self{'bufstart'} >= $$self{'buflen'}) { }
2372 1 8 if defined $path
2386 0 9 unless open FILE, "<$fullpath"
2392 0 68 if ($@)
2455 0 8 unless defined $args{'filename'}
2456 0 8 unless defined $args{'packagename'}
2474 8 0 if ($$self{'checkmode'} == $HTML::CMTemplate::CHECK_STAT)
2476 0 8 if ($self->__exists_file_package__($filename, $packagename))
2482 0 0 if ($oldtime == $mtime)
2493 0 0 if ($incstat->mtime != $oldincmtime)
2501 0 0 unless $inc_out_of_date
2519 0 8 if (defined $ra_cleanref and ref $ra_cleanref eq 'HASH')
2522 0 8 if (defined $ra_dirtyref and ref $ra_dirtyref eq 'HASH')
2531 0 8 if (defined $ra_cleanref)
2534 0 0 if ($@)
2541 0 8 if (defined $ra_dirtyref)
2544 0 0 if ($@)
2589 6 113 unless ($clean_namespace{$key})
0 0 shift() ? :
0 0 unless $pristine_namespace{$key}
0 0 if $add_to_clean
0 0 if (defined $val)
2590 0 8 if ($@)
2681 0 13 unless (defined $packagename)