Branch Coverage

blib/lib/Text/MetaText.pm
Criterion Covered Total %
branch 176 256 68.7


line true false branch
130 30 55 unless ($self->_symbol_defined($file))
131 0 30 unless defined $self->_parse_file($file)
169 0 0 unless defined($block = $self->_parse_text($text))
235 1 1 if ($ref = ref $input) { }
238 1 0 if ($ref eq 'ARRAY')
243 0 1 if scalar @$symtabent
258 1 0 $self->_parse_text($input, $name) ? :
335 2 11 unless defined $cfg
338 0 11 unless (ref $cfg eq 'HASH')
346 7 8 if (/^(MAXDEPTH|LIB|DELIMITER|CASE|CHOMP|TRIM|EXECUTE)$/i)
352 0 8 if (/^FILTER$/i)
362 0 8 if (/^DEBUGLEVEL$/i)
364 0 0 unless defined $$DBGNAME{$_}
375 3 5 if (/^ROGUE$/i)
379 4 0 if ($rogue =~ /^warn|delete$/i) { }
393 1 4 if (/^CASEVARS$/i)
394 1 0 if (ref $$cfg{$_} eq 'ARRAY') { }
407 0 4 if (/^MAGIC$/i)
408 0 0 if (ref $$cfg{$_} eq 'ARRAY') { }
421 4 0 if (/^(ERROR|DEBUG)(FN)?$/i)
423 0 4 unless ref $$cfg{$_} eq 'CODE'
431 0 0 if (/^FACTORY$/i)
432 0 0 unless UNIVERSAL::isa($$cfg{$_}, $Text::MetaText::FACTORY)
445 0 11 if ($$self{'DEBUGLEVEL'} & 2)
487 30 0 if (defined $$self{'LIB'} and not $filepath =~ m[^[/\.]])
492 39 0 unless $filepath =~ m[/$]
496 30 9 if -f $filepath
501 0 30 unless (defined($$self{'FILE'} = 'FileHandle'->new($filepath)))
540 1 0 defined $symbol ? :
592 50 0 defined $symbol ? :
596 0 50 if ($depth > $$self{'MAXDEPTH'})
610 2 48 if scalar @$symtabent
613 0 50 unless $factory = $self->_factory
643 101 229 unless ($4)
646 0 101 unless (defined($nextline = $self->_get_line))
663 70 159 if length $1
668 223 6 unless $$self{'CHOMP'} and $5 eq "\n"
671 229 0 if (defined $2)
677 0 229 unless (defined $directive)
688 0 229 unless $$directive{'PARAMS'}
700 19 210 if ($$directive{'TYPE'} =~ /^END(BLOCK|IF)?$/)
711 19 191 if ($$directive{'TYPE'} eq 'BLOCK')
723 0 19 unless defined $block
727 0 19 unless ($$self{'ENDTAG'} =~ /^END(BLOCK)?$/)
735 4 15 defined $$directive{'TRIM'} ? :
15 4 if (defined $$directive{'TRIM'} ? $$directive{'TRIM'} : $$self{'TRIM'})
738 12 3 if $$block[0] eq "\n"
747 0 19 if (defined $$directive{'PRINT'})
764 542 211 if length $line
812 0 85 if ($depth > $$self{'MAXDEPTH'})
818 0 85 if (ref $symbol eq 'ARRAY') { }
824 0 85 unless ($self->_symbol_defined($symbol))
833 0 85 unless $factory = $self->_factory
865 656 220 unless (UNIVERSAL::isa($item, $directive))
868 6 650 if $item =~ /^__(MT)?END__$/
879 42 178 if ($$item{'HAS_CONDITION'})
882 40 2 if (defined $$item{'IF'})
885 20 20 unless defined $result and $result > 0
889 2 20 if (defined $$item{'UNLESS'})
892 1 1 if defined $result and $result != 0
906 37 162 if ($type eq 'DEFINE')
919 59 103 if ($type eq 'INCLUDE')
933 0 59 unless defined $proctext
939 7 52 $$item{'HAS_POSTPROC'} ? :
945 103 0 if ($type eq 'SUBST')
950 98 5 if (defined $proctext) { }
952 5 93 if $$item{'HAS_POSTPROC'}
957 2 3 if defined $$self{'ROGUE'}{'WARN'}
966 2 3 $$self{'ROGUE'}{'DELETE'} ? :
1013 679 225 unless (@{$$self{'LINES'};})
1015 647 32 if (defined $$self{'FILE'}) { }
1 31 elsif (defined $$self{'TEXT'}) { }
1020 30 617 if $$self{'FILE'}->eof
1033 223 681 if ($$self{'PUTBACK'}) { }
1065 0 223 unless defined $line
1100 13 122 unless (defined $$self{'FACTORY'})
1102 0 13 unless $$self{'FACTORY'} = $Text::MetaText::FACTORY->new
1134 306 0 unless $$self{'CASE'}
1162 140 30 exists $$self{'SYMTABLE'}{$symbol} ? :
1189 136 0 defined $symbol ? :
1194 0 136 unless defined $symbol
1201 49 87 unless defined $$self{'SYMTABLE'}{$symbol}
1233 213 0 unless $$self{'CASE'}
1266 1 122 if defined $$self{'CASEVARS'}{$variable} and defined $$tags{$variable}
1270 2 120 if $variable eq 'TIME'
1313 0 152 ref $expr eq 'SCALAR' ? :
1320 20 0 defined($s2 = $self->_variable_value($2, $tags)) ? :
1403 94 9 if defined($value = $self->_variable_value($ident, $tags))
1408 5 4 unless $$self{'EXECUTE'}
1418 2 2 if ($$self{'EXECUTE'} and $self->can($ident))
1427 0 2 unless $$self{'EXECUTE'} > 1
1432 0 2 unless defined($fn = *glob{'CODE'})
1497 2 0 if $_[0]
1498 0 0 unless $_[0]
1500 2 2 if $_[0]
1501 0 0 unless $_[0]
1504 162 162 /^\w+$/ ? :
1526 16 38 if ($expr eq '1' or $expr eq '0')
1542 0 0 unless defined($sub = $self->_evaluate($sub, $tags))
1549 0 38 if ($expr =~ /[\(\)]/)
1559 6 32 if ($expr =~ /(.*?)\s*($boolkeys)\s*(.*)/)
1568 1 5 &{$$boolean{$op};}($lhs = $self->_evaluate($lhs, $tags), $rhs = $self->_evaluate($rhs, $tags)) ? :
1586 28 4 if ($expr =~ /^\s*(.*?)\s*($compkeys)\s*(.*?)\s*$/)
1603 32 0 unless $$self{'CASE'}
1616 4 28 unless ($op)
1617 2 2 $lhs ? :
1618 2 2 $lhs ? :
1626 4 24 if ($rhs =~ s/^\$(.*)/$1/) { }
1629 4 0 unless $$self{'CASE'}
1648 28 0 unless ($$self{'CASE'})
1658 16 12 &{$$compare{"\L$op\E"};}($lhs, $rhs) ? :
1696 0 12 if ($$self{'DEBUGLEVEL'} & 128)
1700 0 0 if length $dbgline > 16
1709 0 12 unless defined $line and length $line
1714 0 12 if chomp $line
1721 4 8 if (defined $$directive{'FILTER'})
1736 4 0 if (ref $$self{'FILTER'}{$fltname} eq 'CODE') { }
1750 0 8 if ($$self{'DEBUGLEVEL'} & 16)
1780 9 3 if (defined $$directive{'FORMAT'})
1785 4 5 if not $format =~ /\W/ and defined $$formats{uc $format}
1791 1 8 if $fmtdate and $format =~ s/%P//g
1805 1 11 $fmtdate ? :
1810 0 12 if ($$self{'DEBUGLEVEL'} & 16)
1844 0 0 unless $factory = $self->_factory
1850 0 0 if (ref $_ eq $directive)
1882 2 0 if defined $$self{'ERRORFN'}
1946 3450 0 unless ($$self{'DEBUGLEVEL'} & $level) == $level
1948 0 0 if defined $$self{'DEBUGFN'}