Branch Coverage

blib/lib/HTML/Template/HTX.pm
Criterion Covered Total %
branch 211 254 83.0


line true false branch
156 2 18 if ($arg =~ /^(template|filename)$/o) { }
1 17 elsif ($arg eq 'output') { }
1 16 elsif ($arg eq '-utf8') { }
1 15 elsif ($arg =~ /^-/o) { }
8 7 elsif (not defined $template_file) { }
7 0 elsif (not defined $output_file) { }
171 0 10 unless defined $template_file
172 2 8 unless defined $output_file
176 1 9 if (not ref $template_file) { }
178 0 1 unless defined $file
185 2 8 if $] >= 5.008 and ref $file ne 'SCALAR'
189 3 7 if (not ref $output_file) { }
191 0 3 unless (defined $output)
197 2 5 if ref $output_file eq 'SCALAR' and not defined $$output_file
202 4 6 if $] >= 5.008 and ref $output ne 'SCALAR'
215 1 9 $utf8 ? :
223 1 9 if @common
251 1 59 if $#_ == 0
254 37 22 if $#_ == 1
257 3 19 if ($#_ == 2)
316 6 10 if (not defined $$self{'_rest'}) { }
319 1 5 if (defined $_[1] and $_[1] =~ /\n/o) { }
4 1 elsif ($_[1]) { }
324 3 1 unless ($content_type =~ m[/]o)
326 1 2 if $$self{'_utf8'}
337 2 14 if not $first_time and $$self{'_stats'}
346 9 7 if ($$self{'_rest'} ne '') { }
0 7 elsif (not $is_scalar) { }
352 6 1 $first_time ? :
356 12 3 if ($found = /<%begindetail%>/io) { }
358 12 0 if $` ne ''
367 3 0 if $is_scalar
370 4 12 unless $found
373 3 9 if $$self{'_stats'}
378 12 0 if ($$self{'_rest'} ne '') { }
383 0 0 $is_scalar ? :
387 12 0 if ($found = /<%enddetail%>/io) { }
389 12 0 if $` ne ''
398 0 0 if $is_scalar
403 0 12 unless $found
405 3 9 unless $found
420 13 2 if $_[0]{'_stats'}
423 15 0 if (_print($_[0], $_[0]{'_detail'}))
424 13 2 if $_[0]{'_stats'}
464 3 7 if (defined $output and $$self{'_close_output'}) { }
473 1 9 if (defined $file and $$self{'_close_file'}) { }
479 0 10 unless $closed_output and $closed_file
628 0 5 unless @_
634 2 4 defined $_[0] && !($_[0] =~ /^-/o) ? :
637 3 3 if ($option eq '-count')
638 2 1 unless defined $arg
639 2 1 if ($arg) { }
640 2 0 unless ($$self{'_stats'})
651 3 0 if ($option eq '-date')
652 2 1 unless defined $arg
763 6 2 unless defined $_[1]
811 5 2 if (defined $enable) { }
812 2 3 $enable ? :
816 2 5 unless $$self{'_utf8'} ne $enable
851 6 3 unless $_[0]{'_closed'}
865 1 0 if (defined $file)
867 1 0 if $] >= 5.008
891 15 92 if ($_[1] =~ /^"(.*)"$/o)
898 66 26 if (exists $_[0]{'_param'}{$_[1]}) { }
1 25 elsif (exists $ENV{$_[1]}) { }
906 67 25 if (defined $value)
908 67 0 if ($] >= 5.006)
909 0 67 if ($] < 5.008) { }
914 0 0 unless $_[0]{'_utf8'}
917 27 40 if $_[0]{'_utf8'}
924 12 13 if ($_[1] ne '' and $_[1] =~ /^$HTML::Template::HTX::_is_number$/o)
944 0 26 unless $_[1] =~ /^(.+?)\s+(.+?)(\s+(.+?))?$/o
950 1 25 if ($operator eq 'istypeeq')
958 40 10 if (defined $$_) { }
960 17 23 unless $$_ ne '' and $$_ =~ /^$HTML::Template::HTX::_is_number$/o
968 10 15 if ($operator eq 'isempty')
974 4 11 if ($string_compare)
980 1 14 if ($operator eq 'contains')
986 0 14 unless exists $HTML::Template::HTX::_operator{$operator}
990 3 11 if ($string_compare) { }
999 0 14 if $@
1018 42 18 if $encoding eq 'html'
1021 2 16 if $encoding eq 'url'
1024 2 14 if ($encoding eq 'js')
1035 2 12 if ($encoding eq 'scramble')
1043 5 34 if ($c =~ /^[\x00-\x1F"\\\@\x7F-\xFF]$/o) { }
6 28 elsif ($previous == 0) { }
13 15 elsif ($previous == 1) { }
1046 5 1 if $c =~ /^[0-9A-Za-z]$/o
1048 0 13 if $c =~ /^[0-7]$/o
1050 29 10 if $method == -1
1052 9 30 if ($method == 0) { }
15 15 elsif ($method == 1) { }
1089 25 95 if (not $condition) { }
11 84 elsif ($statement eq 'escaperaw') { }
18 66 elsif ($statement eq 'escapehtml') { }
1 65 elsif ($statement eq 'escapeurl') { }
1 64 elsif ($statement eq 'escapejs') { }
1 63 elsif ($statement eq 'escapescramble') { }
0 63 elsif ($statement eq 'include') { }
13 50 elsif ($statement eq 'if') { }
14 36 elsif ($statement eq 'else') { }
4 32 elsif ($statement eq 'endif') { }
9 23 elsif ($statement eq 'detailsection') { }
1094 0 25 if ($statement eq 'if') { }
2 23 elsif ($statement eq 'else') { }
15 8 elsif ($statement eq 'endif') { }
1099 2 0 if $if_count == 0
1103 0 15 if ($if_count > 0) { }
1164 2 7 if $$self{'_stats'}
1176 1 50 unless $condition
1182 1 50 unless $condition
1197 31 6 if (not ref $scalar) { }
1204 37 0 if (ref $$self{'_output'} eq 'SCALAR') { }
0 0 elsif ($$ref ne '') { }
1205 37 0 if $$ref ne ''
1207 0 0 unless print {$$self{'_output'};} $$ref
1225 20 15 if (defined $number)
1226 15 5 $number ? :
1231 18 17 if (defined $count)
1232 13 5 $count ? :
1237 15 20 if (defined $total)
1238 13 2 $total ? :
1243 4 31 if defined $section
1253 0 3 unless defined $epoch_time
1259 0 3 if ($ltm[5] > $gmt[5] or $ltm[5] == $gmt[5] and $ltm[7] > $gmt[7]) { }
0 3 elsif ($ltm[5] < $gmt[5] or $ltm[5] == $gmt[5] and $ltm[7] < $gmt[7]) { }