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') { }
76 8 101 if ($self->tag eq 'input') { }
19 82 elsif ($self->tag eq 'option') { }
4 78 elsif ($self->tag eq 'optgroup' and ref $data eq 'HASH') { }
77 4 4 if ((ref $data || '') eq 'HASH') { }
78 1 3 if (exists $data->{'selected'})
83 1 3 if (($self->attr('type') || '') eq 'checkbox') { }
90 16 3 if ((ref $data || '') eq 'HASH') { }
92 2 14 if $data->{'selected'}
100 4 0 if (my $option_dom = $self->at('option')) { }
113 1 167 if ($self->tag || '') eq 'form'
114 75 93 if (ref \$data eq 'SCALAR') { }
3 90 elsif (ref $data eq 'CODE') { }
41 49 elsif (ref $data eq 'ARRAY') { }
49 0 elsif (ref $data eq 'HASH') { }
0 0 elsif (&Scalar::Util::blessed($data)) { }
122 9 32 if (($self->tag || '') eq 'ol' or ($self->tag || '') eq 'ul') { }
5 27 elsif (($self->tag || '') eq 'select') { }
130 2 3 if (my $optgroup = $self->at('optgroup')) { }
3 0 elsif (my $option = $self->at('option')) { }
145 16 33 if (($self->tag || '') eq 'option' and exists $data->{'content'} and exists $data->{'value'}) { }
4 29 elsif (($self->tag || '') eq 'optgroup' and exists $data->{'options'} and exists $data->{'label'}) { }
4 25 elsif (($self->tag || '') eq 'input' and exists $data->{'value'}) { }
164 33 21 unless ($is_loop)
166 13 20 if ($dom = $self->at("#$match")) { }
0 20 elsif ($dom = $self->at("*[data-lace-id='${match}']")) { }
167 1 12 if $dom->tag eq 'form'
171 0 0 if $dom->tag eq 'form'
178 0 34 if $dom->tag eq 'form'
182 7 34 if ($is_form)
200 0 0 if ($data->isa('Template::Lace::DOM')) { }
205 0 0 unless ($is_loop)
207 0 0 if $dom
232 2 1 unless ($self->at("script[src='${src}']"))
233 2 0 unless $attrs
243 3 3 ref $_[0] ? :
244 1 5 ($dom->tag || '') eq $tag ? :
246 6 0 if (my $id = $dom->attr('href')) { }
247 6 0 if (my $head = $self->at('head')) { }
248 2 4 if ($self->at($tag . "[href='${id}']")) { }
266 6 3 ref $_[0] ? :
267 4 5 ($dom->tag || '') eq $tag ? :
269 9 0 if (my $id = $dom->attr('id')) { }
270 9 0 if (my $head = $self->at('head')) { }
271 3 6 if ($self->at($tag . "[id='${id}']")) { }
289 3 5 ref $_[0] ? :
290 1 7 ($dom->tag || '') eq $tag ? :
292 6 2 if (my $id = $dom->attr('id')) { }
2 0 elsif (my $src = $dom->attr('src')) { }
293 6 0 if (my $head = $self->at('head')) { }
294 2 4 if ($self->at($tag . "[id='${id}']")) { }
304 2 0 if (my $head = $self->at('head')) { }
305 1 1 if ($self->at($tag . "[src='${src}']")) { }
331 1 100 unless defined $value
338 0 9 if ($attr eq ':content') { }
2 7 elsif ($attr eq 'checked' or $attr eq 'selected' or $attr eq 'hidden') { }
345 2 0 if $val
353 7 9 if ($maybe_attr) { }
3 6 elsif (not ref $action) { }
354 0 7 unless $self->tag
355 1 6 if ($maybe_attr eq '*') { }
356 0 1 unless ref $action eq 'HASH'
362 2 1 if (defined $action) { }
377 12 2 if ($css ne '.') { }
417 1 1 if (ref $proto[0] eq 'HASH') { }
0 1 elsif (ref $proto[0] eq 'ARRAY') { }
431 1 2 if (ref $proto[0] eq 'HASH') { }
1 1 elsif (ref $proto[0] eq 'ARRAY') { }
445 1 0 if $value
458 7 15 if (ref $proto eq 'CODE') { }
7 8 elsif (ref $proto) { }
483 4 0 ref $proto eq 'ARRAY' ? :
493 0 1 ref $proto eq 'ARRAY' ? :
500 2 1 if (ref $proto eq 'HASH') { }
1 0 elsif (ref $proto eq 'ARRAY') { }
530 0 2 $name =~ /^\.#/ ? :
536 0 1 $name =~ /^\.#/ ? :