Condition Coverage

blib/lib/Keyword/Declare.pm
Criterion Covered Total %
condition 39 69 56.5


and 3 conditions

line !l l&&!r l&&r condition
814 0 0 0 $param->{'sigil'} && $param->{'sigil'} eq '@'
817 11 139 1 $param->{'sigil'} && $param->{'sigil'} eq '@'
1037 4 0 0 $count > $NESTING_THRESHOLD and $trace =~ /(\w++) --> .+ --> \1/u
1062 1 1 5 $kind_a eq 'typename' and $kind_b eq 'typename'
1082 1 5 2 $is_narrower and $is_narrower == -$partial_ordering

or 2 conditions

line l !l condition
20 0 18 $opt_ref //= {}
356 291 36 $^H{'Keyword::Simple/keywords'} // {}
465 0 0 $PPR::ERROR // ''
517 122 33 $dispatcher_for{$keyword_name} //= sub { my($src_ref) = @_; my($package, $file, $line) = caller; local $PPR::ERROR; my(@candidate_IDs) = @^H{grep {/^ Keyword::Declare \s+ active:$keyword_name:/msux;} keys %^H}; my(@active_IDs) = @^H{grep {/^ Keyword::Declare \s+ active:/msux;} keys %^H}; my $lexical_keywords = @active_IDs ? join('|', reverse sort(map({$keyword_impls[$_]{'skip_matcher'};} @active_IDs))) : '(?!)'; $lexical_keywords = "(?(DEFINE) (? $lexical_keywords ) )"; my(@viable_IDs) = grep({$$src_ref =~ / \A $keyword_impls[$_]{'sig_matcher'} $lexical_keywords $PPR::GRAMMAR /msux;} @candidate_IDs); unless (@viable_IDs) { my $error = eval "no strict;sub{\n" . ($PPR::ERROR // '') . '}' ? " $keyword_name " . do { my $src = $$src_ref; $src =~ s/ \A \s*+ (\S++ [^\n]*+) \n .* /$1/sux; $src } : do { my $err = $@; $err =~ s/^/ /gmu; $err =~ s/\(eval \d++\) line \d++/"$file line " . $PPR::ERROR->line($line);/egu; $err }; croak('Invalid ' . join(' or ', &uniqstr(map({$keyword_impls[$_]{'desc'};} @candidate_IDs))) . " at $file line $line.\nExpected:" . join("\n ", '', &uniqstr(map({$keyword_impls[$_]{'syntax'};} @candidate_IDs))) . "\nbut found:\n$error" . "\nCompilation failed"); } ; if (@viable_IDs > 1) { my $max_sig_len = &max(map({$keyword_impls[$_]{'sig_len'};} @viable_IDs)); @viable_IDs = grep({$keyword_impls[$_]{'sig_len'} == $max_sig_len;} @viable_IDs); if (@viable_IDs > 1) { @viable_IDs = _resolve_matches(@viable_IDs); } ; if (@viable_IDs > 1) { if (my(@preferred_IDs) = grep({$keyword_impls[$_]{'prefer'};} @viable_IDs)) { @viable_IDs = @preferred_IDs; } ; } ; if (@viable_IDs > 1) { croak('Ambiguous ' . join(' or ', &uniqstr(map({$keyword_impls[$_]{'desc'};} @viable_IDs))) . " at $file line ${line}:\n $keyword_name " . do { my $src = $$src_ref; $src =~ s/ \A \s*+ ( \S++ [^\n]*+) \n .* /$1/sux; $src } . "\nCould be:\n" . join("\n", map({" $keyword_impls[$_]{'syntax'}";} @viable_IDs)) . "\nCompilation failed"); } ; } ; my($ID) = @viable_IDs; _insert_replacement_code($src_ref, $ID, $file, $line, $lexical_keywords); }
668 2 161 $user_defined_type_for //= {map({/ \A Keyword::Declare \s* keytype: (\w+) = (.*) /msux;} keys %^H)}
774 6 81 delete $obj->{'____KD___sep'} // ''
854 158 11 $param->{'name'} // ''
993 0 18 $keyword->{'sig_defaults'}{$argname} // ''
1014 71 0 $keyword->{'generator'}->(@args) // ''

or 3 conditions

line l !l&&r !l&&!r condition
24 0 0 18 @_ > 2 or $arg_type ne 'HASH'
25 0 0 0 $arg_type ||= $opt_ref
416 0 0 0 $source_cache->{$filename} //= do { local(*ARGV, $/); @ARGV = $filename; readline ARGV }
674 13 153 0 $user_defined_type_for->{$type} // $ACTUAL_TYPE_OF{$type}
153 0 0 ($user_defined_type_for->{$type} // $ACTUAL_TYPE_OF{$type}) // croak("Unknown type ($type) for keyword parameter.\nDid you mean: ", join(' or ', grep({lc substr($_, 0, 1) eq lc substr($type, 0, 1);} keys %ACTUAL_TYPE_OF)))
715 0 158 0 $param->{'desc'} //= do { my $desc = $param->{'name'} ? "<$param->{'name'}>" : '<' . join(' or ', @types) . '>'; $desc =~ tr/_/ /; $desc }
728 0 7 0 $param->{'desc'} //= $param->{'name'} ? do { my $name = "<$param->{'name'}>"; $name =~ tr/_/ /; $name } : $1
741 158 6 0 $param->{'desc'} //= $param->{'name'} ? do { my $name = "<$param->{'name'}>"; $name =~ tr/_/ /; $name } : "/$match{'pattern'}/$match{'modifiers'}"
814 0 0 0 $param->{'quantifier'} //= $param->{'sigil'} && $param->{'sigil'} eq '@' ? '*' : '?'
817 18 1 150 $param->{'quantifier'} //= $param->{'sigil'} && $param->{'sigil'} eq '@' ? '+' : ''
858 6 3 149 $param->{'sigil'} ne '$' || $single_matcher =~ /\(\?
1085 0 5 1 $partial_ordering ||= $is_narrower