Branch Coverage

blib/lib/String/Tagged.pm
Criterion Covered Total %
branch 215 244 88.1


line true false branch
126 64 207 if &blessed($_[0])
150 20 110 if is_string_tagged($str)
152 5 105 unless defined $str
235 3 23 &blessed($_[0]) ? :
241 1 25 exists $opts{'only_tags'} ? :
245 0 26 exists $opts{'except_tags'} ? :
255 1 25 if $only and not $only->{$tn}
256 0 0 if $except and $except->{$tn}
259 2 23 if ($convert and my $c = $convert->{$tn}) { }
260 1 1 if (ref $c eq 'CODE') { }
322 2 10 is_string_tagged($format) ? :
334 9 13 if ($str =~ /\G[^%]+/cgu) { }
1 12 elsif ($str =~ /\G%%/cgu) { }
10 2 elsif ($str =~ /\G%([-]?)(\d+|\*)?(?:\.(\d+|\*))?s/cgu) { }
2 0 elsif ($str =~ /\G%(.*?)([cduoxefgXEGbBpaAiDUOF])/cgu) { }
0 0 elsif ($str =~ /\G%(.*?)([a-zA-Z])/cgu) { }
346 1 9 if defined $width and $width eq "*"
347 1 9 if defined $precision and $precision eq "*"
350 0 10 unless (defined $arg)
355 2 8 if (defined $precision)
356 0 2 if (is_string_tagged($arg)) { }
366 4 6 defined $width ? :
367 1 9 if $padding < 0
371 8 2 unless $leftalign
375 2 8 if $leftalign
422 1 0 unless is_string_tagged($sep)
499 5 25 if $te < $start
500 2 23 if $ts >= $end
503 1 22 if $te <= 0
505 13 9 if $ts < 0 or $tf & 1
506 13 9 if $te > $end or $tf & 2
508 13 9 $te == -1 ? :
548 0 0 if @$tags < 2
555 0 0 if (_cmp_tags() <= 0)
577 74 70 if (@$tags == 0)
589 14 56 if (_cmp_tags() <= 0)
595 54 2 if (_cmp_tags() >= 0)
611 2 0 if ($cmp > 0) { }
0 0 elsif ($cmp < 0) { }
622 2 0 if ($range_start == $range_end)
628 0 2 unless defined $inspos
630 0 2 if $inspos < 0
631 0 2 if $inspos > @$tags
670 25 116 if (&blessed($_[0])) { }
675 8 17 if $e->anchor_before
676 6 19 if $e->anchor_after
684 25 91 if ($start < 0)
689 30 86 if ($len == -1) { }
695 6 80 if $end > $strlen
712 0 4 if (&blessed($_[0])) { }
732 1 7 if $te <= $start
733 3 4 if $ts >= $end
735 0 4 if $tn ne $name
737 2 2 if ($keepends and $end < $te)
744 1 3 if ($keepends and $ts < $start) { }
839 1 10 if $t2s > $te
840 0 10 unless $t2s <= $te
841 3 7 unless $t2n eq $tn
843 1 6 unless &$eqsub($tn, $tv, $t2v)
852 1 5 if $t2f & 2
856 1 5 if (local $b = $$tags[$i + 1] and _cmp_tags() > 0)
916 1 75 exists $opts{'start'} ? :
920 0 75 exists $opts{'len'} ? :
1 75 exists $opts{'end'} ? :
922 1 75 exists $opts{'only'} ? :
925 1 75 exists $opts{'except'} ? :
933 1 96 if $te < $start
934 1 95 if $ts >= $end
936 2 93 if $only and not $only->{$tn}
937 1 2 if $except and $except->{$tn}
1002 2 32 exists $opts{'start'} ? :
1006 0 32 exists $opts{'len'} ? :
2 32 exists $opts{'end'} ? :
1008 1 33 exists $opts{'only'} ? :
1011 1 33 exists $opts{'except'} ? :
1022 2 74 if $te < $start
1023 2 72 if $ts > $end
1025 2 70 if $only and not $only->{$tn}
1026 1 2 if $except and $except->{$tn}
1036 14 28 if $e < $rangeend
1037 1 41 if $tagends{$n} and $tagends{$n} < $e
1060 20 52 if $e < $rangeend
1061 1 71 if $tagends{$n} and $tagends{$n} < $e
1074 1 2 if $_->[0] == $pos
1 33 if (my(@zerolen) = grep({$_->[1] == $pos if $_->[0] == $pos;} @active))
1186 3 11 if $ts > $pos
1187 1 10 if $te <= $pos
1216 4 11 if $ts > $pos
1217 3 8 if $te <= $pos
1219 6 2 if $tn eq $name
1248 1 13 if $ts > $pos
1249 1 12 if $te <= $pos
1251 3 9 unless $tn eq $name
1258 9 1 if (defined $start) { }
1290 3 3 unless $tn eq $name
1292 1 2 if ($ts <= $pos and $te > $pos)
1296 1 1 if ($ts > $pos)
1342 0 56 if $start > $limit
1343 0 56 if $len > $limit - $start
1363 12 30 if $ts >= $start and not $tf & 1
1372 16 14 if ($te > $oldend or $te == $oldend and $tf & 2) { }
1 13 elsif ($te > $start) { }
1377 0 16 if ($t->[0] == $t->[1])
1394 10 3 if $ts >= $oldend
1400 2 1 if ($te <= $oldend) { }
1421 11 1 unless $tf & 1
1430 6 1 if _cmp_tags() <= 0
1438 21 35 if (is_string_tagged($new))
1444 0 21 $atstart && $e->anchor_before ? :
5 16 $atend && $e->anchor_after ? :
1497 18 38 if is_string_tagged($new)
1511 16 30 if $t->[4] & 2
1568 3 14 ref $self eq 'String::Tagged' && is_string_tagged($other) ? :
1572 11 6 if $swap
1683 2 3 if @- > 1
1687 1 4 if defined $limit and @ret == $limit - 1
1690 3 1 if (CORE::length $plain > $prev)
1752 6 1 if CORE::length $name > $maxnamelen
1758 1 6 $tf & 1 ? :
1764 1 6 if ($tl == 0) { }
2 4 elsif ($tl == 1) { }
1777 1 6 $tf & 2 ? :