Branch Coverage

blib/lib/Keyword/Declare.pm
Criterion Covered Total %
branch 130 174 74.7


line true false branch
24 0 18 if (@_ > 2 or $arg_type ne 'HASH')
32 0 18 if ($opt_ref->{'debug'})
54 0 9 unless $$src_ref =~ s/ \A (? (?&PerlNWS) (?{ $expected = 'new type name'; $failed_at = pos $_; }) (? \$?+ ) (? (?&PerlIdentifier) ) (?&PerlOWS) (?{ $expected = q['is ']; $failed_at = pos $_; }) is (?&PerlOWS) (?{ $expected = q[existing typename or literal string or regex after 'is']; $failed_at = pos $_; }) (? (? (?&PerlMatch) ) | (? (?&PerlString) ) | (? $TYPE_JUNCTION ) ) ) $PPR::GRAMMAR //msux
85 3 6 if ($keytype_info{'typesigil'})
87 2 1 if ($keytype_info{'oldtyperegex'}) { }
1 0 elsif ($keytype_info{'oldtypestring'}) { }
89 1 1 if ($keytype_info{'oldtyperegex'} =~ /\(\?\&Perl[A-Z]/u)
103 0 9 if ($^H{'Keyword::Declare debug'})
129 136 18 @active_IDs ? :
138 0 154 unless $$src_ref =~ s/ \A (?<____K_D___KeywordDeclaration> (?&PerlNWS) (?<____K_D___keyword> (?&PerlIdentifier) ) (?&PerlOWS) (?{ $expected = q[keyword parameters or block, or 'from' specifier]; $failed_at = pos $_; }) (?<____K_D___params> (?&____K_D___ParamList) ) (?&PerlOWS) (?{ $expected = 'keyword block or attribute'; $failed_at = pos $_; }) (?<____K_D___attrs> (?&PerlAttributes)?+ ) (?&PerlOWS) (?{ $expected = 'keyword block'; $failed_at = $block_start = pos $_; }) (?<____K_D___block> \{\{\{ .*? \}\}\} | (?&PerlBlock) ) ) (?(DEFINE) (?<____K_D___ParamList> \( (?&____K_D___ParamSet)?+ (?: (?&PerlOWS) \) (?&PerlOWS) :then\( (?{ push @params, undef; }) (?&____K_D___ParamSet) )?+ \) | # Nothing ) (?<____K_D___ParamSet> (?&PerlOWS) (?&____K_D___Param) (?: (?&PerlOWS) , (?&PerlOWS) (?&____K_D___Param) )*+ ,?+ (?&PerlOWS) ) (?<____K_D___Param> (?{ $expected = 'keyword parameter type'; $failed_at = pos $_; }) (?<____K_D___type> (?&PerlMatch) | (?&PerlString) | $TYPE_JUNCTION ) (?{ $expected = 'keyword parameter quantifier or variable'; $failed_at = pos $_; }) (?: (?&PerlOWS) (?<____K_D___quantifier> [?*+][?+]?+ ) )?+ (?{ $expected = 'keyword parameter variable'; $failed_at = pos $_; }) (?: (?&PerlOWS) (?<____K_D___sigil> [\$\@] ) (?<____K_D___name> (?&PerlIdentifier) ) )?+ (?: (?&PerlOWS) :sep \( (?{ $expected = 'keyword parameter separator :sep'; $failed_at = pos $_; }) (?&PerlOWS) (?<____K_D___sep> (?&PerlMatch) | (?&PerlString) | $TYPE_JUNCTION ) (?&PerlOWS) \) )?+ (?: (?&PerlOWS) = (?{ $expected = 'keyword parameter default string after ='; $failed_at = pos $_; }) (?&PerlOWS) (?<____K_D___default> (?&PerlQuotelikeQ) ) )?+ (?{ push @params, {%+}; }) ) (? keyword (?&____K_D___KeywordDeclaration) | $lexical_keywords ) ) $PPR::GRAMMAR //msux
222 0 154 if ($keyword_info{'keyword'} =~ /^(?:keyword|keytype)$/u)
231 23 131 if ($keyword_info{'block'} =~ / \A \{\{\{ /msux)
252 0 154 if ($^H{'Keyword::Declare debug'})
298 0 1 if defined $keyword_info{'unexpected'}
301 0 1 if ($keyword_info{'keyword'} =~ /^(?:keyword|keytype)$/u)
306 0 1 if ($^H{'Keyword::Declare debug'})
317 0 1 if ($Keyword::Simple::VERSION < 0.04)
341 0 327 unless $kw =~ /^[^\W\d]\w*\z/u
342 0 327 unless ref $sub eq 'CODE'
344 0 327 if ($VERSION < 0.04) { }
372 0 1 unless substr($data, -1) eq "\n"
388 1 323 unless defined $hash_ref
447 71 0 @active_IDs ? :
458 0 71 unless (@viable_IDs)
465 0 0 eval "no strict;sub{\n" . ($PPR::ERROR // '') . '}' ? :
479 23 48 if (@viable_IDs > 1)
485 3 20 if (@viable_IDs > 1)
490 1 22 if (@viable_IDs > 1)
491 1 0 if (my(@preferred_IDs) = grep({$keyword_impls[$_]{'prefer'};} @viable_IDs))
497 0 23 if (@viable_IDs > 1)
677 1 162 if ($type =~ /\A (?: q\s*\S | ' ) (.*) \S \z /ux) { }
161 1 elsif ($type =~ /$REGEX_TYPE/u) { }
1 0 elsif ($type =~ /$TYPE_JUNCTION/u) { }
681 0 161 unless $type =~ /$REGEX_PAT/u
705 158 13 if ($type =~ /\A \w++ (?: [|] \w++ )* \Z/ux)
716 152 6 $param->{'name'} ? :
725 7 164 if ($type =~ /\A (?: q\s*\S | ' ) (.*) \S \z /ux) { }
164 0 elsif ($type =~ /$REGEX_TYPE/u) { }
728 3 4 $param->{'name'} ? :
736 0 164 unless $type =~ /$REGEX_PAT/u
741 5 1 $param->{'name'} ? :
771 26 87 unless keys %{$captures_ref;}
795 1 169 unless (defined $param)
805 2 167 if ($param->{'sep'})
810 0 169 if (exists $param->{'default'}) { }
814 0 0 $param->{'sigil'} && $param->{'sigil'} eq '@' ? :
817 1 150 $param->{'sigil'} && $param->{'sigil'} eq '@' ? :
822 169 0 unless $param->{'type'} =~ m[^/\(\?\&Perl[ON]WS\)/$]u
826 19 150 if ($param->{'quantifier'})
828 17 2 if (not $sep) { }
834 1 1 if $param->{'quantifier'} eq '*'
842 158 11 if ($param->{'name'})
848 167 2 if $not_post
857 158 11 if ($param->{'name'}) { }
858 9 149 $param->{'sigil'} ne '$' || $single_matcher =~ /\(\?
864 152 6 $param->{'sigil'} eq '$' ? :
904 145 9 $sig_vars ? :
913 3 151 if ($keyword_info_ref->{'attrs'})
921 0 3 if ($keyword_info_ref->{'attrs'} =~ s/\bdesc\( (.*?) \)//msux) { }
929 0 3 if ($keyword_info_ref->{'attrs'} =~ s/\bprefix\( \s* (\$[^\W\d]\w*) \s* \)//msux)
935 0 3 if $keyword_info_ref->{'attrs'} =~ s/\bthen\b//msux
937 0 3 if $keyword_info_ref->{'attrs'} =~ /[^\s:]/u
950 6 17 if ($block =~ / <\{ (? (? \s* \S*) .*? ) (?: <\{ | \302\253 | \Z ) /msux)
954 0 6 unless $match{'interpolation'} =~ / \}> /msux
956 10 13 if ($block =~ / \302\253 (? (? \s* \S*) .*? ) (?: <\{ | \302\253 | \Z ) /msux)
960 0 10 unless $match{'interpolation'} =~ / \302\273 /msux
971 43 22 if (exists $+{'literal_code'}) { }
22 0 elsif (exists $+{'interpolation'}) { }
993 18 87 if $args{$argname} eq ''
1001 81 18 /\S/u ? :
18 99 !defined($_) ? :
1008 71 0 unless $keyword->{'keepspace'}
1017 0 71 if ($^H{'Keyword::Declare debug'})
1037 0 4 if $count > $NESTING_THRESHOLD and $trace =~ /(\w++) --> .+ --> \1/u
1055 1 7 if $type_a eq $type_b
1058 1 6 $type_a =~ m[\A/|\Am\W]msux ? :
0 7 $type_a =~ /\A'|\Aq\W/u ? :
1059 1 6 $type_b =~ m[\A/|\Am\W]msux ? :
0 7 $type_b =~ /\A'|\Aq\W/u ? :
1062 5 2 if ($kind_a eq 'typename' and $kind_b eq 'typename')
1063 2 3 if $isa{join $;, $type_a, $type_b}
1064 3 0 if $isa{join $;, $type_b, $type_a}
1082 2 6 if $is_narrower and $is_narrower == -$partial_ordering
1098 0 14 if ($derived) { }
1122 1 4 if ($narrowness > 0) { }
2 2 elsif ($narrowness < 0) { }
1132 1 2 unless $unique_narrowest