Branch Coverage

blib/lib/OptArgs2.pm
Criterion Covered Total %
branch 93 184 50.5


line true false branch
34 0 0 if ($^O eq 'MSWin32') { }
71 0 1 if @_
74 0 1 unless exists $error_types{$type}
103 0 4 unless exists $usage_types{$type}
105 0 4 if (-t STDERR)
107 0 0 if $str =~ /\n\z/
109 0 0 if ($lines >= rows())
135 1 10 if (not @_ and @ARGV)
139 1 0 if ($CODESET)
154 0 6 if exists $COMMAND{$class}
171 0 6 if exists $COMMAND{$class}
173 1 5 unless $class =~ /(.+)::(.+)/
181 0 5 unless exists $COMMAND{$parent_class}
197 0 0 unless exists $COMMAND{$class}
236 0 0 unless 3 == @_
301 0 6 if $self->required and defined $self->default
311 0 4 if (defined $value) { }
322 3 1 if ($self->required)
323 3 0 if length $comment
359 0 8 if (exists $ref->{'ishelp'})
364 6 2 if ($ref->{'isa'} =~ /^Help/)
376 0 0 if ($val == 1) { }
0 0 elsif ($val == 2) { }
396 0 8 unless (exists $isa2getopt{$ref->{'isa'}})
403 0 8 if ($ref->{'name'} =~ /_/)
407 6 2 if $ref->{'alias'}
418 0 4 if ($self->isa eq "Bool")
419 0 0 if ($value) { }
0 0 elsif (not defined $value) { }
429 4 0 if (length $alias)
435 0 4 if (defined $value) { }
436 0 0 if ($self->isa eq 'Flag') { }
0 0 elsif ($self->isa eq 'Bool') { }
0 0 elsif ($self->isa eq 'Counter') { }
440 0 0 $value ? :
457 0 4 if ($self->required)
458 0 0 if length $comment
510 0 11 if ("CODE" eq ref $self->optargs)
517 2 6 if ($args->{'isa'} =~ s/^--//) { }
554 0 5 if exists $self->_subcmds->{$subcmd->name}
575 19 4 unless $self->parent
584 0 8 if not defined $_
609 0 13 if (exists $source_hash->{$name}) { }
616 0 13 if (defined $result and my $t = $try->trigger)
620 1 12 if (defined($result //= $try->default)) { }
0 12 elsif ($try->required) { }
622 0 1 if ('CODE' eq ref $result) { }
639 7 4 if (@$source and my(@subcmds) = @{$cmd->subcmds;})
641 2 5 if ($cmd->abbrev)
648 4 3 if (exists $cmd->_subcmds->{$result})
664 4 3 if (@$source) { }
0 3 elsif (exists $source_hash->{$name}) { }
665 0 4 if ($source->[0] =~ /^--\S/ or $source->[0] =~ /^-\S/ and not $source->[0] =~ /^-\d/ && ($try->isa ne 'Num' || $try->isa ne 'Int'))
686 0 4 if ($try->greedy) { }
0 4 elsif ($try->isa eq 'ArrayRef') { }
0 4 elsif ($try->isa eq 'HashRef') { }
697 0 0 if ($try->isa eq 'ArrayRef' or $try->isa eq 'SubCmd') { }
0 0 elsif ($try->isa eq 'HashRef') { }
732 4 3 if (defined($result //= $try->default)) { }
2 1 elsif ($try->required) { }
740 0 2 'HASH' eq ref $result ? :
0 2 'ARRAY' eq ref $result ? :
2 2 if $try->isa eq "SubCmd" and not $try->fallthru
747 0 4 if ('CODE' eq ref $result) { }
762 0 11 if (@$source) { }
0 11 elsif (my(@unexpected) = keys %$source_hash) { }
779 4 7 if $reason
804 0 8 if ($style eq "HelpTree")
822 0 0 if ($overlap > 0 and not $paged)
843 0 8 if @parents and $style ne "HelpSummary"
848 0 8 if ($self->show_color)
857 2 6 if length $error
862 1 3 unless $arg->required
864 0 4 if $arg->greedy
865 1 3 unless $arg->required
868 4 4 if $style eq "HelpSummary"
870 4 0 if @opts
874 0 4 if $style eq "Help" and length $self->comment
882 4 0 if (@args)
885 4 0 if ($arg->isa eq 'SubCmd') { }
889 0 4 $arg->show_default ? :
897 4 0 unless $style eq "Help"
916 0 0 unless $i
919 0 0 $arg->show_default ? :
930 4 0 if (@opts)
933 0 4 if $style ne "Help" and $opt->hidden
936 0 4 $opt->show_default ? :
954 4 0 if (@sargs)
962 0 4 if (@uargs)
971 4 0 if (@uopts)
993 0 4 if ($x eq 'main') { }
1012 6 0 unless $self->no_help or "CODE" eq ref $self->optargs