Branch Coverage

blib/lib/Template/Lace/DOM.pm
Criterion Covered Total %
branch 120 156 76.9


line true false branch
16 0 2 ref $proto[0] eq 'HASH' ? :
24 1 0 if (ref $_[0] eq 'ARRAY') { }
71 8 94 if ($self->tag eq 'input') { }
19 75 elsif ($self->tag eq 'option') { }
4 71 elsif ($self->tag eq 'optgroup' and ref $data eq 'HASH') { }
72 4 4 if ((ref $data || '') eq 'HASH') { }
73 1 3 if (exists $data->{'selected'})
78 1 3 if (($self->attr('type') || '') eq 'checkbox') { }
85 16 3 if ((ref $data || '') eq 'HASH') { }
87 2 14 if $data->{'selected'}
95 4 0 if (my $option_dom = $self->at('option')) { }
108 1 157 if ($self->tag || '') eq 'form'
109 68 90 if (ref \$data eq 'SCALAR') { }
3 87 elsif (ref $data eq 'CODE') { }
41 46 elsif (ref $data eq 'ARRAY') { }
46 0 elsif (ref $data eq 'HASH') { }
0 0 elsif (&Scalar::Util::blessed($data)) { }
117 9 32 if (($self->tag || '') eq 'ol' or ($self->tag || '') eq 'ul') { }
5 27 elsif (($self->tag || '') eq 'select') { }
125 2 3 if (my $optgroup = $self->at('optgroup')) { }
3 0 elsif (my $option = $self->at('option')) { }
140 16 30 if (($self->tag || '') eq 'option' and exists $data->{'content'} and exists $data->{'value'}) { }
4 26 elsif (($self->tag || '') eq 'optgroup' and exists $data->{'options'} and exists $data->{'label'}) { }
4 22 elsif (($self->tag || '') eq 'input' and exists $data->{'value'}) { }
159 21 27 unless ($is_loop)
161 13 8 if ($dom = $self->at("#$match")) { }
0 8 elsif ($dom = $self->at("*[data-lace-id='${match}']")) { }
162 1 12 if $dom->tag eq 'form'
166 0 0 if $dom->tag eq 'form'
173 0 28 if $dom->tag eq 'form'
177 7 28 if ($is_form)
195 0 0 if ($data->isa('Template::Lace::DOM')) { }
200 0 0 unless ($is_loop)
202 0 0 if $dom
227 2 1 unless ($self->at("script[src='${src}']"))
228 2 0 unless $attrs
238 3 3 ref $_[0] ? :
239 1 5 ($dom->tag || '') eq $tag ? :
241 6 0 if (my $id = $dom->attr('href')) { }
242 6 0 if (my $head = $self->at('head')) { }
243 2 4 if ($self->at($tag . "[href='${id}']")) { }
261 6 3 ref $_[0] ? :
262 4 5 ($dom->tag || '') eq $tag ? :
264 9 0 if (my $id = $dom->attr('id')) { }
265 9 0 if (my $head = $self->at('head')) { }
266 3 6 if ($self->at($tag . "[id='${id}']")) { }
284 3 5 ref $_[0] ? :
285 1 7 ($dom->tag || '') eq $tag ? :
287 6 2 if (my $id = $dom->attr('id')) { }
2 0 elsif (my $src = $dom->attr('src')) { }
288 6 0 if (my $head = $self->at('head')) { }
289 2 4 if ($self->at($tag . "[id='${id}']")) { }
299 2 0 if (my $head = $self->at('head')) { }
300 1 1 if ($self->at($tag . "[src='${src}']")) { }
326 1 93 unless defined $value
333 0 9 if ($attr eq ':content') { }
2 7 elsif ($attr eq 'checked' or $attr eq 'selected' or $attr eq 'hidden') { }
340 2 0 if $val
348 7 9 if ($maybe_attr) { }
3 6 elsif (not ref $action) { }
349 0 7 unless $self->tag
350 1 6 if ($maybe_attr eq '*') { }
351 0 1 unless ref $action eq 'HASH'
357 2 1 if (defined $action) { }
372 12 2 if ($css ne '.') { }
412 1 1 if (ref $proto[0] eq 'HASH') { }
0 1 elsif (ref $proto[0] eq 'ARRAY') { }
426 1 2 if (ref $proto[0] eq 'HASH') { }
1 1 elsif (ref $proto[0] eq 'ARRAY') { }
440 1 0 if $value
453 7 15 if (ref $proto eq 'CODE') { }
7 8 elsif (ref $proto) { }
478 4 0 ref $proto eq 'ARRAY' ? :
488 0 1 ref $proto eq 'ARRAY' ? :
495 2 1 if (ref $proto eq 'HASH') { }
1 0 elsif (ref $proto eq 'ARRAY') { }
510 0 2 $name =~ /^\.#/ ? :
516 0 1 $name =~ /^\.#/ ? :