Branch Coverage

blib/lib/Template/Alloy/TT.pm
Criterion Covered Total %
branch 238 286 83.2


line true false branch
25 27 4286 shift() ? :
26 0 4313 unless ($str_ref and defined $$str_ref)
33 4236 77 !$self->{'INTERPOLATE'} ? :
40 4313 0 unless $self->{'COMPILE_JS'}
56 4286 27 unless $one_tag_only
60 1844 12237 if ($continue) { }
27 12210 elsif ($one_tag_only) { }
68 4201 8009 unless $$str_ref =~ / \G (.*?) $self->{'_start_tag'} /cgsx
73 2425 5584 if (length $text)
74 2063 362 if (not $post_chomp) { }
272 90 elsif ($post_chomp == 1) { }
0 90 elsif ($post_chomp == 2) { }
90 0 elsif ($post_chomp == 3) { }
78 2153 272 if length $text
82 107 7902 if ($dollar)
84 9 98 $text =~ / (\\+) $ /x ? :
85 18 89 if ($self->{'_no_interp'} or $n % 2)
87 18 0 if defined $pointer->[-1] and not ref $pointer->[-1]
88 6 12 if $n % 2
89 18 0 if ($prev_text) { }
96 37 52 if ($$str_ref =~ / \G \{ /cgx) { }
99 0 37 unless $$str_ref =~ / \G \s* $QR_COMMENTS \} /cgx
106 0 89 unless defined $ref
108 12 59 if (not $not and $self->{'SHOW_UNDEFINED_INTERP'})
119 221 7681 $$str_ref =~ / \G ([+=~-]) /cgx ? :
120 224 7678 if $pre_chomp
121 107 117 if ($pre_chomp and $pointer->[-1] and not ref $pointer->[-1])
122 77 30 if ($pre_chomp == 1) { }
0 30 elsif ($pre_chomp == 2) { }
30 0 elsif ($pre_chomp == 3) { }
125 87 20 unless length $pointer->[-1]
129 21 7881 if ($$str_ref =~ / \G \# /cgx)
130 0 21 unless $$str_ref =~ / \G (.*?) ([+~=-]?) ($self->{'_end_tag'}) /cgsx
138 0 21 if $post_chomp
145 256 8224 $self->{'ANYCASE'} ? :
4430 5322 if ($$str_ref =~ / \G \s* $QR_COMMENTS $Template::Alloy::Parse::QR_DIRECTIVE /cgox and $func = $self->{'ANYCASE'} ? uc $1 : $1 and $dirs->{$func} || (pos $$str_ref -= length $1) && 0) { }
5094 207 elsif (defined(my $var = $self->parse_expr($str_ref))) { }
152 92 4338 if $aliases->{$func}
157 152 4278 if ($dirs->{$func}[3] and $post_op) { }
3 4275 elsif ($post_op and $self->{'SEMICOLONS'}) { }
136 4139 elsif ($capture) { }
178 27 4400 if (my $err = $@)
179 27 0 if UNIVERSAL::can($err, 'node') and not $err->node
185 1291 3109 if ($func eq 'END' or $dirs->{$func}[4]) { }
1081 2028 elsif ($dirs->{$func}[2] and not $post_op) { }
75 1953 elsif ($func eq 'TAGS') { }
134 1819 elsif ($func eq 'META') { }
186 9 1282 unless (@state)
191 219 1063 if ($func ne 'END')
195 3 216 unless ($dirs->{$func}[4]{$parent_type})
201 1137 142 !@state ? :
204 1063 216 if ($func eq 'END') { }
205 433 630 if ($parent_node->[0] eq 'BLOCK') { }
56 574 elsif ($parent_node->[0] eq 'VIEW') { }
21 553 elsif ($$dirs{$parent_node->[0]}[5]) { }
206 38 395 if (defined $parent_node->[3] and @in_view) { }
209 339 56 if length $parent_node->[3]
212 380 53 if ($pointer->[-1] and not $pointer->[-1][6])
232 56 1025 if $func eq 'VIEW'
233 21 1060 if $$dirs{$node->[0]}[5]
239 66 9 if ($$str_ref =~ / \G \s* $QR_COMMENTS ([+~=-]?) $old_end /cgsx)
243 0 66 if $post_chomp
258 15 42 if ($post_op and $self->{'SEMICOLONS'})
262 804 4275 if ($$str_ref =~ / \G \s* $QR_COMMENTS ($Template::Alloy::TT::QR_OP_ASSIGN) >? (?! [+=~-]? $self->{'_end_tag'}) \s* $QR_COMMENTS /cgx) { }
265 0 804 if (my $err = $@)
266 0 0 if UNIVERSAL::can($err, 'node') and not $err->node
270 21 4254 if ($self->{'AUTO_FILTER'})
271 3 18 unless ref $var
272 15 6 if @$var < 3 or $var->[-3] ne '|'
281 7757 1851 if ($$str_ref =~ / \G \s* $QR_COMMENTS (?: ; \s* $QR_COMMENTS)? ([+=~-]?) $self->{'_end_tag'} /cgsx)
282 27 7730 if ($one_tag_only)
283 0 27 if $1
284 0 27 if @state > 0
289 662 7068 if $post_chomp
296 1292 559 if ($$str_ref =~ / \G ; \s* $QR_COMMENTS /cgox) { }
136 423 elsif ($node->[6]) { }
310 7 1844 if $continue == pos $$str_ref
315 259 3942 if @blocks
316 134 4067 if @meta
317 15 4186 if @state > 0
320 1031 3155 if (pos $$str_ref != length $$str_ref)
322 972 59 if (not $post_chomp) { }
29 30 elsif ($post_chomp == 1) { }
0 30 elsif ($post_chomp == 2) { }
30 0 elsif ($post_chomp == 3) { }
326 987 44 if length $text
338 24 3703 if ($self->{'DEBUG'})
339 24 0 $self->{'DEBUG'} =~ /^\d+$/ ? :
18 6 if $self->{'DEBUG'} =~ /^\d+$/ ? $self->{'DEBUG'} & 8 : $self->{'DEBUG'} =~ /dirs|all/
340 24 0 $self->{'DEBUG'} =~ /^\d+$/ ? :
6 18 if $self->{'DEBUG'} =~ /^\d+$/ ? $self->{'DEBUG'} & 2 : $self->{'DEBUG'} =~ /undef|all/
344 1 0 $#ARGS == 0 && UNIVERSAL::isa($ARGS[0], 'HASH') ? :
1 3726 if scalar @ARGS
348 3726 1 if (ref $in) { }
349 3722 4 if (ref $in eq 'SCALAR') { }
1 3 elsif (UNIVERSAL::isa($in, 'CODE')) { }
1 2 elsif (ref $in eq 'HASH') { }
390 36 3691 if ($self->{'PRE_PROCESS'})
399 39 3685 if $self->{'WRAPPER'}
402 33 3691 if (exists $self->{'PROCESS'}) { }
405 0 39 unless length $name
417 201 3523 if (my $err = $@)
418 0 201 unless UNIVERSAL::can($err, 'type')
419 0 201 if $err->type =~ /stop|return/
421 24 21 unless ref $catch
426 45 15 !defined($name) || lc $name eq 'default' ? :
427 51 6 if ($type =~ / ^ \Q$_name\E \b /x and !defined($last_found) || length $last_found < length $_name)
435 45 0 if (defined $file)
437 0 45 $self->{'COMPILE_JS'} ? :
438 3 42 if $self->{'WRAPPER'}
444 39 3529 if (exists $self->{'WRAPPER'})
447 0 42 unless length $name
454 12 24 if ($self->{'STREAM'})
460 22 3543 if length $pre
463 36 3529 if ($self->{'POST_PROCESS'})
473 0 3727 if exists $self->{'AUTO_RESET'} and not $self->{'AUTO_RESET'}
475 165 3562 if (my $err = $@)
476 0 165 unless UNIVERSAL::can($err, 'type')
477 165 0 unless ($err->type =~ /stop|return|next|last|break/)
479 0 165 if $self->{'RAISE_ERROR'}
486 3559 3 if (ref $out) { }
2 1 elsif ($out) { }
487 1 3558 if (UNIVERSAL::isa($out, 'CODE')) { }
1 3557 elsif (UNIVERSAL::can($out, 'print')) { }
3554 3 elsif (UNIVERSAL::isa($out, 'SCALAR')) { }
1 2 elsif (UNIVERSAL::isa($out, 'ARRAY')) { }
500 0 2 if ($out =~ m[^/]) { }
0 2 elsif ($out =~ m[^\.\.?/]) { }
501 0 0 if (not $self->{'ABSOLUTE'}) { }
507 0 0 if (not $self->{'RELATIVE'}) { }
514 0 2 unless defined $path
515 0 2 unless (-d $path)
522 0 2 unless open my $fh, '>', $file
523 1 1 if (my $bm = $args->{'binmode'}) { }
0 1 elsif ($self->{'ENCODING'}) { }
524 1 0 if ($bm == 1) { }
527 0 0 if (eval { do { require Encode } } and defined &Encode::encode)
536 6 3556 if $self->{'error'}
542 15 129 if $self->{'_template'}
548 0 129 ref $content eq 'HASH' ? :
550 12 74 $doc->{'_tree'} && ref $doc->{'_tree'}[0] && $doc->{'_tree'}[0][0] eq 'META' ? :
43 86 $doc->{'_perl'} ? :
552 12 117 if ref $meta eq 'ARRAY'