Branch Coverage

blib/lib/PPIx/QuoteLike.pm
Criterion Covered Total %
branch 152 222 68.4


line true false branch
71 2 112 if ($arg{'location'})
73 0 2 unless "ARRAY" eq ref $arg{'location'}
75 0 8 if $arg{'location'}[$inx] =~ / [^0-9] /msx
80 114 0 unless (defined $arg{'index_locations'})
96 52 62 unless defined(my $string = $self->_stringify_source($source))
102 0 62 if $arg{'trace'}
105 9 53 if ($string =~ / \A \s* ( q [qx]? ) ( \s* ) ( . ) /cgmsx) { }
7 46 elsif ($string =~ / \A \s* ( << ) ( \s* ) ( ~? ) ( \s* ) ( [\\]? \w+ | $match_sq | $match_dq | $match_bt ) \n /cgmsx) { }
46 0 elsif ($string =~ / \A \s* ( [`'"<] ) /cgmsx) { }
107 0 9 if not $gap and $start_delim =~ / \A \w \z /msx
112 0 9 if $arg{'trace'}
117 9 0 if ($end_delim eq substr($content, -1)) { }
132 0 7 if $arg{'trace'}
138 7 0 if ($content =~ s/ ^ ( [ \t]* ) \Q$end_delim\E \n? \z //msx) { }
142 4 3 if ($indented)
167 0 46 if $arg{'trace'}
171 46 0 if ($end_delim eq substr($content, -1)) { }
180 0 0 if $arg{'trace'}
185 49 13 $self->{'interpolates'} ? :
189 7 55 length $gap ? :
4 58 length $indented ? :
0 62 length $gap2 ? :
205 0 62 if $arg{'trace'}
209 49 13 if ($self->{'interpolates'}) { }
213 4 144 if ($content =~ / \G ( \\ [ULulQEF] ) /cgmsx) { }
1 143 elsif ($content =~ / \G ( \\ N [{] ( [^}]+ ) [}] ) /cgmsx) { }
51 92 elsif ($content =~ / \G ( [\$\@] \#? \$* ) /cgmsx) { }
43 49 elsif ($content =~ / \G ( \\ . | [^\\\$\@]+ ) /cgmsx) { }
228 1 0 $name =~ / [\$\@] /msx ? :
259 10 3 if length $content
269 4 58 if $self->{'indentation'}
271 7 55 if ($self->{'finish'}) { }
282 17 45 if ref $_[1]
363 0 54 unless defined(my $val = $self->$method)
365 54 0 ref $val ? :
390 0 1 ref $target ? :
0 1 'CODE' eq ref $target ? :
393 1 4 if &$check($elem)
398 0 1 unless @found
406 0 109 unless $self->{'finish'}
408 55 54 if wantarray
436 1 325 if "PPIx::QuoteLike::Token::Unknown" eq $class
438 100 226 if $self->{'index_locations'}
445 0 100 if $token->{'location'}
451 17 2 if (__instance($self->{'source'}, "PPI::Element"))
453 17 0 if (my $doc = $self->{'source'}->document)
461 0 100 unless $loc->{'location'}
464 100 0 if (defined(my $content = $token->content))
469 4 96 if (pos $content)
476 83 17 if (my $chars = length($content) - pos($content))
478 4 79 if ($loc->{'tab_width'} > 1 and $content =~ / \t /msx) { }
484 5 5 if ($part eq "\t") { }
517 0 58 if (defined(my $ver = $elem->perl_version_removed))
518 0 0 if (defined $max) { }
519 0 0 if $ver < $max
550 0 109 unless $self->{'start'}
552 55 54 if wantarray
564 0 88 unless $self->{'type'}
566 55 33 if wantarray
573 6 34 unless $self->interpolates
599 23 0 unless defined $encoding and _encode_available()
610 0 0 if defined $encode_available
611 0 0 eval { do { require Encode; 1 } } ? :
636 0 17 unless my $doc = $elem->top
639 6 11 if $cached_doc and $doc == $cached_doc
643 0 11 unless my $bom = $doc->first_element
648 0 11 if ($bom->isa("PPI::Token::BOM"))
656 10 1 unless $doc->find("PPI::Statement::Include")
658 0 2 unless "use" eq $use->type
660 0 2 unless defined(my $module = $use->module)
662 2 0 unless "utf8" eq $module
702 14 37 if ($_[2] =~ / \G (?= \{ ) /cgmsx)
705 14 0 if ($_[2] =~ / \G $delim_re /cgmsx)
707 9 5 unless $rest =~ / \A \{ \s* \[ ( .* ) \] \s* \} \z /msx
711 3 2 if _has_postderef("$1")
715 0 0 if $_[2] =~ / \G ( .* ) /cgmsx
721 34 3 if ($_[2] =~ m( \G ( @{[qr/ [[:alpha:]_]\w* (?: :: [[:alpha:]_] \w* )* | \^ [A-Z_] | [0-9]+ | [-!"#\$%&'()+,.\/:;<=>?[\\\]^_`{|}~] /msx];} ) )cgmosx)
728 2 0 if ($_[2] =~ / \G ( $delim_re ) /cgmsx) { }
741 6 28 if (defined(my $deref = _match_postderef($_[2])))
750 0 3 unless $code = $special{$sigil} and my $elem = &$code($self, $sigil, $_[2])
769 81 245 if ($prev)
791 28 6 unless $_[0] =~ / \G ( -> ) ( \$ \# | [\$\@] ) /cgmsx
795 5 1 if $_[0] =~ / \G ( [*] ) /cgmsx
798 1 0 if ($allow_subscr{$sigil} and $_[0] =~ / \G (?= ( [[{] ) ) /cgmsx)
803 1 0 if $_[0] =~ / \G $re /cgmsx
818 2 3 unless $doc->find("PPI::Token::Symbol")
819 0 3 unless my $next = $elem->snext_sibling
821 0 3 unless $next->isa("PPI::Token::Operator")
823 0 3 unless $next->content eq "->"
825 0 3 unless $next = $next->snext_sibling
827 0 3 unless $next->isa("PPI::Token::Cast")
830 0 3 unless $is_postderef{$content}
832 3 0 if $content =~ / \* \z /msx
834 0 0 unless $next = $next->snext_sibling
836 0 0 if $next->isa("PPI::Structure::Subscript")
859 5 160 if (@rslt and $can_merge{$elem->[0]} and $elem->[0] eq $rslt[-1][0]) { }
881 48 5 unless $self->{'indentation'}
884 2 3 if ($arg{'sibling'}) { }
902 1 6 if ($ignore_first) { }
906 1 5 if ("\n" eq $_) { }
5 0 elsif (s/ ( $self->{'_indentation_re'} ) //msx) { }
929 69 45 if (&Scalar::Util::blessed($string))
931 0 69 unless $string->isa("PPI::Element")
940 212 16 unless $string->isa($class)
943 0 16 if $opt{'test'}
949 1 52 if ($string->isa("PPI::Token::HereDoc"))
951 0 1 if $opt{'test'}
968 0 45 if ref $string
972 0 45 $opt{'test'} ? :
45 0 if $string =~ / \A \s* (?: q [qx]? | << | [`'"<] ) /msx
979 4 3 if $string =~ s/ \A ['"] //msx