Branch Coverage

blib/lib/HTML/Normalize.pm
Criterion Covered Total %
branch 39 126 30.9


line true false branch
218 1 0 unless (ref $self)
240 0 1 unless grep {$_ eq 'div';} @$bar
247 1 0 if $self->{'root'}
262 0 1 unless exists $paramTypes{$key}
264 0 1 if $paramTypes{$key}[0] < 2 and exists $self->{$key}
266 1 0 if ($paramTypes{$key}[0] < 2)
276 0 1 unless exists $paramTypes{$key}
277 0 1 unless exists $self->{$key}
278 1 0 if $paramTypes{$key}[0] != 1 or exists $self->{$key}
298 1 9 if exists $self->{$param}
299 1 8 if $paramTypes{$param}[0] > 1
302 0 8 if $paramTypes{$param}[0] == 1
322 0 0 unless defined $value
330 0 0 if exists $self->{'defaults'}{$tag}{$attrib} and $self->{'defaults'}{$tag}{$attrib} ne $value
332 0 0 if ($value =~ /^()()()$regex$/x) { }
352 0 1 if ($self->{'-selfrender'}) { }
355 0 0 unless $str =~ /\n$/s
359 0 1 if $self->{'-unformatted'}
360 0 1 if $self->{'-compact'}
364 1 0 unless ($self->{'-keepimplicit'})
369 4 0 ref $_ ? :
393 1 0 if $root->tag eq 'body'
404 2 6 unless ref $parent and ref $parent->{'_content'}
414 3 7 unless ref $elt
416 0 7 if $self->_cleanedupElt($elt)
417 2 5 if exists $elt->{'_implicit'}
419 0 5 if $self->_removedDefaults($elt)
420 0 5 if $self->_distributedElements($elt)
421 0 5 if $self->_normalizedElements($elt)
422 0 5 if $self->_expeledBr($elt)
423 0 5 if $self->_removedEmpty($elt)
433 0 5 unless $self->{'-distribute'}
436 5 0 unless $elt->{'_tag'} =~ /$self->{'inline'}/i and $elt->{'_tag'} =~ /$self->{'needattr'}/
439 0 0 if ref $_
442 0 0 unless @elts and @elts == $blockElts
462 5 0 unless $elt->{'_tag'} =~ /$self->{'inline'}/i
470 0 0 unless @elts == 1 and ref $elts[0] and $elts[0]{'_tag'} =~ /$self->{'block'}/
489 5 0 unless $elt->{'_tag'} eq 'a' and $self->{'-expelbr'}
490 0 0 unless exists $elt->{'_content'}
496 0 0 unless ref $br and $br->{'_tag'} eq 'br'
497 0 0 $index == 0 ? :
509 5 0 unless exists $self->{'defaults'}{$elt->{'_tag'}}
514 0 0 unless exists $elt->{$attrib}
520 0 0 if ('Regexp' eq ref $value) { }
521 0 0 unless $elt->{$attrib} =~ /$value/
524 0 0 unless defined $attr
530 0 0 unless $elt->{$attrib} eq $value
537 0 0 if @parentAttribs
547 0 5 if grep {not /^_/;} $elt->all_attr_names
548 5 0 unless $elt->{'_tag'} =~ /$self->{'needattr'}/i
560 0 0 unless $self->{'-keepimplicit'} or not $elt->{'_implicit'} or $elt->{'_content'}
564 0 0 if (not $self->{'-keepimplicit'} and $elt->{'_implicit'}) { }
0 0 elsif ($elt->{'_tag'} =~ /$self->{'selfclose'}/) { }
0 0 elsif ($HTML::Tagset::isPhraseMarkup{$elt->{'_tag'}}) { }
594 0 0 if (length($self->{'line'}) + length($tail) + length($indent) > $self->{'-maxlinelen'}) { }
608 0 0 unless length $self->{'line'}
612 0 0 if ($self->{'-unformatted'}) { }
616 0 0 if ($self->{'ishead'})
648 0 0 if (not ref $subElt) { }
663 0 0 if ($self->{'-unformatted'}) { }
669 0 0 if length $str > $maxLen
671 0 0 unless defined $str
672 0 0 unless defined $self->{'line'}