Branch Coverage

blib/lib/Text/Merge.pm
Criterion Covered Total %
branch 89 170 52.3


line true false branch
386 8 0 if defined $arg
402 0 2 if (not defined $start && defined $end or $start and not $end or not $start and $end)
407 0 2 if ($start =~ /\:/ or $end =~ /\:/)
410 0 2 if ($start =~ /^[\{\}]$/ or $end =~ /^[\{\}]$/)
413 0 2 if ($start and not $start cmp $end)
433 0 402 unless defined $open
434 0 402 unless defined $close
435 0 402 unless ($item)
436 0 402 unless ($ret)
437 401 1 if $open and $close
439 402 0 if $ret
441 401 1 if $open and $close
442 402 0 if $ret
449 114 1073 if ($tag eq 'ACT')
453 294 779 if $formats
457 3 1070 if ref $value eq 'ARRAY' and scalar @$value == 1
476 234 448 if ($pretag =~ /^\{(.*)\}(\w+\:)$/s) { }
478 568 114 if (not $pretag =~ /ACT:/) { }
485 224 458 if $tag eq 'NEG:'
486 448 234 if $tag eq 'NEG:' or $tag eq 'IF:'
487 458 224 if (defined $cond and $cond || length $cond) { }
515 10 7 unless $$data{'Data'} || $$data{'Actions'} and $item = $data
516 0 17 if (not $template) { }
3 14 elsif ($template =~ /\s/s) { }
14 0 elsif (ref($template) =~ /FileHandle/ and $fh = $template or -f $template and $fh = 'FileHandle'->new('<' . $template)) { }
524 3 0 if ($handle) { }
530 5 9 if ($$self{'_Text_Merge_LineMode'}) { }
532 59 0 if ($handle) { }
537 9 0 if ($handle) { }
541 11 3 if $template ne $fh
544 0 0 if (length $template > 50)
562 34 47 unless $$data{'Data'} || $$data{'Actions'} and $item = $data
563 0 81 if (not $template) { }
18 63 elsif ($template =~ /(?:(?:\r?\n)|\r)/ or not +($ref = ref $template) || -f $template) { }
63 0 elsif ($ref and $ref =~ /FileHandle/ and $fh = $template or -f $template and $fh = 'FileHandle'->new($template)) { }
574 62 1 if ($$self{'_Text_Merge_LineMode'}) { }
577 63 0 if $template ne $fh
618 0 0 unless $mailer and $recipient
620 0 0 if $subject
621 0 0 if $from
622 0 0 if $ccaddr
623 0 0 if $replyto
624 0 0 if $ctype
625 0 0 unless $subject
626 0 0 if ($mailer =~ /RECIPIENT/) { }
627 0 0 if ($mailer =~ /SUBJECT/) { }
628 0 0 if $from
629 0 0 if $ccaddr
630 0 0 if $replyto
631 0 0 if $ctype
632 0 0 if ($mailer eq 'SMTP') { }
637 0 0 unless ($fh)
638 0 0 if ($toheader or $subheader or $typeheader or $ccheader)
648 0 0 if $v < 16
668 0 0 $cgi ? :
670 0 0 $cgi ? :
671 0 0 @v > 1 ? :
686 0 358 unless $_ = $style
687 28 0 defined $value ? :
0 0 unless /^upper/i and return uc($value || '') or /^lower/i and return lc($value || '') or /^proper/i and return propnoun($value || '') or /^trunc(?:ate)?(\d+)/ and return substr($value || '', 0, $1) or /^words(\d+)/ and return frstword($value || '', $1) or /^para(?:graph)?(\d+)/ and return paratext($value || '', $1) or /^indent(\d+)/ and return indtext($value || '', $1) or /^int/i and return defined $value ? int $value : 0 or /^float/i and return defined $value && sprintf('%f', $value || 0) || '' or /^string/i and return $value or /^detab/i and return de_tab($value) or /^html/i and return htmlconv($value) or /^dollars/i and return defined $value && length $value && sprintf('%.2f', $value || 0) || '' or /^percent/i and return $value < 0.2 && sprintf('%.1f%%', $value * 100) || sprintf('%d%%', int $value * 100) or /^abbr/i and return abbrdate($value) or /^short/i and return shrtdate($value) or /^time/i and return timeoday($value) or /^24h/i and return time24hr($value) or /^dateonly/i and return dateonly($value) or /^date/i and return fulldate($value) or /^ext/i and return extdate($value) or /^unix/i and return scalar localtime $value or /^urlencode/i and return urlenc($value) or /^urldecode/i and return urldec($value) or /^escape/i and return brsresc($value) or /^unescape/i and return brsruesc($value) or /^list$/ and return ref $value && ' ' . join("\n ", @$value) . "\n" || ' ' . $value . "\n"
755 0 6 unless $ct > 0
764 0 24 unless $input
778 60 204 if ($len > $rem)
779 24 36 if ($word =~ /\-/)
784 48 0 if (length $newword < $rem) { }
796 240 24 if ($rem > 2) { }
799 24 0 if ($rem ne $cols)
811 52 0 if ($hour > 11)
812 0 52 unless ($hour)
813 52 0 if (($min = int $min) < 10)
819 1 13 unless $val
826 1 13 unless $val
833 1 13 unless $val
840 1 13 unless $val
843 0 13 if ($hour = int $hour) < 10
844 13 0 if ($min = int $min) < 10
845 13 0 if ($sec = int $sec) < 10
851 1 13 unless $val
859 1 13 unless $val
867 1 13 unless $val
873 0 13 if ($mday < 4 or $mday > 20)
875 0 0 unless $_ == 1 and $suff = 'st' or $_ == 2 and $suff = 'nd'
890 2 0 if $text
899 0 2 unless $text
907 0 2 if $text