Branch Coverage

blib/lib/Getopt/Modular.pm
Criterion Covered Total %
branch 120 142 84.5


line true false branch
29 9 1 if ($opt eq '-namespace') { }
1 0 elsif ($opt eq '-getOpt') { }
34 0 9 unless eval "\n package $ns;\n \@${ns}::ISA = List::MoreUtils::uniq('Getopt::Modular', \@${ns}::ISA);\n 1; "
44 0 1 unless eval "\n package $package;\n sub getOpt { Getopt::Modular->getOpt(\@_) }\n 1; "
62 0 9 if (any sub { 'global' eq lc $_; } , @_)
81 863 126 if ref $self
863 126 if eval { do { $self->isa('Getopt::Modular') if ref $self } }
84 126 0 if eval { do { not ref $self && $self->isa('Getopt::Modular') } }
87 118 8 $global ? :
104 39 522 if (@_)
110 0 522 unless (exists $$self{'accept_opts'}{$opt})
125 0 9 if @_
140 3 2 if ($_known_modes{$mode}) { }
167 3 2 ref $$opts{'aliases'} ? :
5 37 exists $$opts{'aliases'} ? :
169 10 32 if ($param =~ /\|/)
180 2 40 $self->_accepts_opt($param) ? :
181 40 2 unless $$o{'aliases'}
189 1 23 if (exists $$self{'all_opts'}{$_} and $$self{'all_opts'}{$_} ne $param)
199 2 39 if ($self->_accepts_opt($param)) { }
236 16 0 if $unaccept
250 1 4 unless ($success)
262 6 4 if (exists $opts{$opt}) { }
1 3 elsif ($$accept{$opt}{'mandatory'}) { }
276 1 2 if (@_ and ref $_[0] eq 'HASH')
295 5 60 unless (exists $$self{'accept_opts'}{$opt})
297 3 2 if ($$self{'mode'}{'strict'})
309 15 12 if (not exists $$self{'options'}{$opt} and exists $$self{'accept_opts'}{$opt} and exists $$self{'accept_opts'}{$opt}{'default'})
314 7 8 if (ref $default[0] and ref $default[0] eq 'CODE')
322 50 12 if (exists $$self{'options'}{$opt})
324 8 42 if (wantarray)
328 0 0 ref $$self{'options'}{$opt} eq 'HASH' ? :
8 0 ref $$self{'options'}{$opt} eq 'ARRAY' ? :
342 32 60 unless (exists $self->_opt($opt)->{'_GMTYPE'})
346 6 26 if ($type =~ /\@/) { }
3 23 elsif ($type =~ /\%/) { }
367 4 20 if (not $val =~ /^[-+]?\d+$/)
382 5 12 unless (looks_like_number $val)
411 8 59 if ($type eq '' or $type eq '!') { }
421 59 79 if (my $info = $_valtypes{$_})
423 15 44 if ($type =~ /\@/) { }
7 37 elsif ($type =~ /\%/) { }
439 26 32 if ($self->_opt($opt)->{'validate'})
442 7 18 unless ($self->_opt($opt)->{'validate'}())
444 4 3 if (ref $val)
446 3 1 if ref $val eq 'ARRAY'
447 1 3 if ref $val eq 'HASH'
458 1 49 if (my $valid = $self->_opt($opt)->{'valid_values'})
460 0 1 if (ref $valid eq 'CODE')
467 0 1 if (ref $valid eq 'ARRAY') { }
469 0 0 unless (any sub { $_ eq $val; } , @$valid)
499 9 61 if (ref $_[0]) { }
501 3 6 unless $self->_getType($opt) eq reftype($_[0])
520 6 10 $self->_getType($opt) eq 'HASH' ? :
45 16 !$self->_getType($opt) ? :
536 22 0 if $unaccept
548 0 22 unless $$param_info{'aliases'}
551 14 8 if ($$param_info{'spec'} =~ /!/)
553 14 14 length $_ > 1 ? :
557 36 21 length $_ > 1 ? :
560 0 22 ref $$param_info{'help'} ? :
569 14 8 if ($type eq '' or $type eq '!')
573 14 0 $opt{'default'} ? :
588 2 20 if exists $$param_info{'hidden'}
611 9 0 if exists $$param{'default'}
613 3 6 if ($$param{'valid_values'})
629 1 1 @_ && !ref($_[0]) ? :
665 12 0 if exists $$param{'default'}
666 4 8 if $$param{'valid_values'}
669 6 6 if $available
679 2 0 if ($tb->width > $width)