Branch Coverage

blib/lib/HTML/Truncate.pm
Criterion Covered Total %
branch 59 84 70.2


line true false branch
116 0 2 unless exists $$self{"_$k"}
133 5 188 if (@_) { }
159 6 87 unless defined $chars
160 0 87 unless $chars > 0
161 0 87 unless $chars =~ /^(?:[1-9][_\d]*|0)$/
181 0 1 unless $$self{'_percent'} or $percent
183 0 1 unless $percent
188 0 1 unless $temp_percent and $temp_percent != 0
216 5 89 if (@_) { }
6 83 elsif ($self->utf8_mode) { }
279 0 0 if ($which =~ /\%\z/) { }
292 0 97 unless shift()
294 0 97 if @_
295 0 97 if @_
320 489 950 if ($$next[0] eq 'S')
327 116 501 if $$token[0] eq 'E'
334 253 364 if ($$token[0] eq 'S') { }
116 248 elsif ($$token[0] eq 'E') { }
248 0 elsif ($$token[0] eq 'T') { }
338 0 253 if $$self{'_skip_tags'}{$real_tag}
339 246 7 unless $HTML::Tagset::emptyElement{$real_tag}
344 0 116 if $$self{'_skip_tags'}{$$token[1]}
347 8 108 unless ($open eq $close)
349 8 0 if ($$self{'_repair'}) { }
352 5 3 if $open
355 5 3 if ($temp eq $close) { }
384 0 248 if $$token[2]
388 244 4 if (not first(sub { $_ eq 'pre'; } , @tag_q)) { }
392 10 101 unless ($HTML::Tagset::isPhraseMarkup{$tag_q[-1]} or $HTML::Tagset::isPhraseMarkup{$$previous_token[1]})
400 20 91 unless ($HTML::Tagset::isPhraseMarkup{$tag_q[-1]} or $HTML::Tagset::isPhraseMarkup{$$next_token[1]})
416 85 163 if ($total >= $chars) { }
422 26 59 if ($self->on_space) { }
432 56 29 if (my $cleaner = $self->cleanly)
437 68 17 if ($keep)
456 97 0 if (defined wantarray) { }
482 0 0 if ref $_
498 0 0 if ref $_
500 0 0 unless delete $$self{'_skip_tags'}{$_}
516 3 5 if (@_) { }
536 0 0 unless $$token[0] eq 'T' and not $$token[2]
570 1 85 if (@_) { }
595 2 85 if (@_) { }