Branch Coverage

blib/lib/Getopt/AsDocumented.pm
Criterion Covered Total %
branch 72 116 62.0


line true false branch
53 0 1 if @_ % 2
55 0 1 unless ref $self
203 1 2 if eval "require $m"
207 0 1 unless $mod
227 1 0 if (my $do = $obj->can('config_file'))
232 1 0 if (my $file = &$do($obj) || $lazy && do { $$obj{'config_file'} = &$lazy() })
236 1 0 if -e $file
299 0 0 $type ne 'boolean' && $type ne 'string' ? :
335 0 1 if @_ % 2
340 0 1 if exists $setup{$key}
363 0 1 if (my $pod = $setup{'pod'}) { }
364 0 0 unless open $fh, '<', \$pod
369 0 1 unless open $fh, '<', $file
393 2 24 if ($command =~ /^head/)
394 0 2 if ($$self{'__options'}) { }
1 1 elsif ($p =~ /^options$/i) { }
1 0 elsif ($p =~ /^usage$/i) { }
411 0 24 unless $$self{'__options'}
413 14 10 if ($command eq 'item') { }
1 9 elsif ($command eq 'back') { }
420 14 12 unless $2
424 5 9 if ($p =~ s/ \(([^ ]+)\)$//)
426 9 5 $p ? :
429 1 13 if ($p =~ s/ \[--[^ ]+ \.\.\.\]$//) { }
1 12 elsif ($p =~ /^\w+=/) { }
437 9 5 if $p
438 9 5 if ($p) { }
450 16 10 if ($opt =~ s/^--//) { }
455 0 10 unless $opt =~ s/^-//
456 0 10 unless length $opt == 1
463 1 13 if ($canon =~ /^no_(.*)/)
486 8 1 if ($command eq 'for')
493 0 0 unless ($class->can('VERSION'))
495 0 0 if $@
507 8 0 if ($for_items{$thing}) { }
0 0 elsif (my $do = $for_globals{$thing}) { }
508 0 8 unless $$self{'__current'}
509 6 2 defined $val ? :
512 0 0 if $$self{'__current'}
522 1 1 if (delete $$parser{'__usage'})
534 0 18 unless my $s = $$self{'__current'}
535 4 14 if ($p =~ /^DEFAULT(?::|\s*=)\s*(.*)/) { }
10 4 elsif (not $$s{'help'}) { }
538 0 4 if ($def =~ s/^\\//) { }
0 4 elsif ($def =~ s/^\{//) { }
542 0 0 unless $def =~ s/\}$//
544 0 0 if $@
548 1 3 if ($def =~ s/^(["'])//)
552 1 3 if ($$s{'type'} eq 'boolean')
554 0 1 if $def
574 2 14 unless my $setup = delete $$parser{'__current'}
575 0 14 unless my $name = delete $$setup{'canon'}
582 0 14 if (my $call = $$setup{'call'}) { }
3 11 elsif ($auto_actions{$name}) { }
583 0 0 $call =~ s/^(.*)::// ? :
585 0 0 unless $$setup{'call'} = $handler->can($call)
589 0 3 unless $$setup{'call'} = $self->can($name . '_handler')
599 2 12 if $pos