Branch Coverage

blib/lib/Complete/Getopt/Long.pm
Criterion Covered Total %
branch 125 232 53.8


line true false branch
34 0 1 if $COMPLETE_GETOPT_LONG_TRACE
37 0 0 if ($word =~ /\A\$/ and $COMPLETE_GETOPT_LONG_DEFAULT_ENV)
38 0 0 if $COMPLETE_GETOPT_LONG_TRACE
42 0 0 unless @$compres
50 0 0 if ($word =~ m[\A~([^/]*)\z] and $COMPLETE_GETOPT_LONG_DEFAULT_FILE)
51 0 0 if $COMPLETE_GETOPT_LONG_TRACE
54 0 0 if $@
56 0 0 unless $res->[0] == 200
58 0 0 -d $_->{'home'} ? :
62 0 0 unless @$compres
72 0 0 if ($word =~ m[\A(~[^/]*)/] and $COMPLETE_GETOPT_LONG_DEFAULT_FILE)
73 0 0 if $COMPLETE_GETOPT_LONG_TRACE
85 0 0 if (String::Wildcard::Bash::contains_wildcard($word) and $COMPLETE_GETOPT_LONG_DEFAULT_FILE)
86 0 0 if $COMPLETE_GETOPT_LONG_TRACE
89 0 0 unless @$compres
91 0 0 if -d $_
99 1 0 if ($COMPLETE_GETOPT_LONG_DEFAULT_FILE)
100 0 1 if $COMPLETE_GETOPT_LONG_TRACE
108 0 1 if $COMPLETE_GETOPT_LONG_TRACE
119 166 108 unless index($_, $opt) == 0
121 28 80 if $opt eq $_
130 0 48 unless $opthash
134 88 544 if $v->{'ospec'} eq $ospec
295 0 35 unless $args{'words'}
297 0 35 unless defined(my $cword = $args{'cword'})
298 0 35 unless my $gospec = $args{'getopt_spec'}
305 1 34 if (ref $gospec eq "HASH")
309 2 0 if ref $gospec->{$_}
314 0 35 if $COMPLETE_GETOPT_LONG_TRACE
318 1 34 if ref $gospec->[0] eq "HASH"
325 3 210 $i + 1 <= $#{$gospec;} && ref $$gospec[$i + 1] ? :
328 0 213 unless my $res = Getopt::Long::Util::parse_getopt_long_opt_spec($ospec)
330 0 213 if $res->{'is_arg'}
331 81 132 $res->{'type'} ? :
332 83 130 $res->{'type'} || $res->{'opttype'} ? :
334 24 339 $res->{'is_neg'} && length $o0 > 1 ? :
340 152 259 length $o == 1 || !$bundling && $res->{'dash_prefix'} eq '-' ? :
357 0 169 unless $extras
359 169 0 unless $ggls_res
361 0 0 unless $r
366 0 0 unless $ospec
370 0 0 if defined $ospecmeta->{'summary'}
372 0 0 if ($ospecmeta->{'is_alias'})
375 0 0 length $real_opt == 1 ? :
379 0 0 if (defined(my $coptname = $ospecmeta->{'common_opt'})) { }
382 0 0 $r->{'common_opts'} ? :
0 0 $cmdline ? :
384 0 0 unless $coptspec
388 0 0 if ($opts{$optname}{'is_neg'}) { }
390 0 0 if defined $summ
392 0 0 length $pos_opt == 1 ? :
396 0 0 if defined $summ
398 0 0 if defined $summ
409 0 0 if ($ospecmeta->{'is_neg'}) { }
411 0 0 if defined $summ
413 0 0 length $pos_opt == 1 ? :
417 0 0 if defined $summ
419 0 0 if defined $summ
446 32 48 if ++$i >= @words
450 0 48 if ($word eq "--" and $i != $cword)
454 0 0 if $i >= @words
459 41 7 if ($word =~ /\A-/) { }
465 29 12 unless $opts{"-" . substr($word, 1, 1)}
468 1 11 unless $bundling
477 7 20 unless $rest =~ s/(.)//
480 0 20 unless ($opthash)
489 4 16 if ($opthash->{'parsed'}{'max_vals'})
493 2 2 if ($i == $j) { }
501 2 2 if (length $rest) { }
504 1 1 $j > $i ? :
505 1 1 $j > $i ? :
508 1 1 $j > $i ? :
510 1 1 $j > $i ? :
513 0 4 if ($rest =~ s/\A=//)
517 2 2 if ($expand)
525 9 7 if ($i == $j) { }
535 0 11 $encounter_equal_sign ? :
551 4 37 if ($word =~ /\A(--?[^=]+)(=)(.*)/)
554 4 0 if $cword >= $i
561 28 13 if (keys %$matching_opts == 1) { }
574 3 25 if ($i + 1 < @words and $words[$i + 1] eq "=")
579 1 2 if $max_vals < $min_vals
584 3 13 if $i >= @words
590 0 1 if $i + $_ >= @words
591 0 1 if $words[$i + $_] =~ /\A-/
605 1 12 if ($i + 1 < @words and $words[$i + 1] eq "=")
608 1 0 if ($i + 1 < @words)
638 2 33 if $word =~ /\A[^-]/
639 7 26 unless exists $exp->{'optname'}
641 0 26 if defined $exp->{'do_complete_optname'} and not $exp->{'do_complete_optname'}
642 2 24 if ($exp->{'comp_result'})
653 50 197 if $exp->{'short_only'} and $optname =~ /\A--/
654 34 163 if ($seen_opts{$optname})
658 1 33 if (ref $dest eq 'ARRAY') { }
3 30 elsif ($parsed->{'desttype'} or $parsed->{'is_inc'}) { }
671 14 2 if $seen_opts{$optname} and not $repeatable and !$opt || $opt ne $optname || defined $exp->{'prefix'} && index($exp->{'prefix'}, substr($opt, 1, 1)) >= 0
672 18 151 if (defined $exp->{'prefix'}) { }
679 0 169 if (length $summ) { }
692 0 24 if $COMPLETE_GETOPT_LONG_TRACE
695 17 6 unless (exists $exp->{'optval'} or exists $exp->{'arg'})
703 8 10 unless exists $exp->{'optval'}
706 9 1 if $opt
715 10 0 if ($comp)
716 0 10 if $COMPLETE_GETOPT_LONG_TRACE
719 2 8 if defined $exp->{'prefix'}
720 0 10 if $COMPLETE_GETOPT_LONG_TRACE
722 0 10 unless ($compres and $comp)
725 0 0 if defined $exp->{'prefix'}
726 0 0 if $COMPLETE_GETOPT_LONG_TRACE
734 11 7 unless exists $exp->{'arg'}
742 0 7 if $COMPLETE_GETOPT_LONG_TRACE
744 6 1 if $comp
745 1 6 unless (defined $compres)
747 0 1 if $COMPLETE_GETOPT_LONG_TRACE
753 0 18 if $COMPLETE_GETOPT_LONG_TRACE
756 0 35 if $COMPLETE_GETOPT_LONG_TRACE