Branch Coverage

blib/lib/Getopt/O2.pm
Criterion Covered Total %
branch 132 160 82.5


line true false branch
22 1 26 ref $_[0] ? :
45 5 41 if (not defined $arg && length $arg or '-' eq $arg or not $arg =~ /^-/) { }
2 39 elsif ('--' eq $arg) { }
53 14 25 if (not $arg =~ /^--/) { }
56 1 13 unless defined $rule
60 5 8 if (length $arg > 2)
61 1 4 if ($rule->type) { }
70 1 24 if (~index($key, '='))
76 5 20 unless (defined $rule)
77 2 3 if 0 != index($key, 'no-')
82 2 1 unless defined $rule and $rule->negatable
88 1 33 if (defined $rule->context)
91 1 0 unless exists $context{$_}
98 3 30 if ($rule->multiple)
100 1 2 unless exists $self->{'options'}{$rule->long}
106 24 6 if (defined $rule->type) { }
110 2 22 unless defined $arg
113 14 8 if $rule->is_unused
117 5 17 if $rule->is_list and not defined $self->{'options'}{$rule->long}
124 1 1 unless &looks_like_number($arg)
131 1 8 unless $rule->values
2 7 unless $arg ~~ \@{[] unless $rule->values;}
135 13 6 if ($rule->is_list)
136 7 6 if ('?' ne $rule->type) { }
140 5 1 unless $rule->keep_unique and $arg ~~ \@{$self->{'options'}{$rule->long};}
150 1 11 if (defined $rule->action) { }
153 1 4 $rule->{'_negate'} ? :
5 6 unless defined $arg
163 2 8 if ref $args
178 5 0 if 'perl' eq $program
191 1 23 unless @ARGV
194 21 0 if not defined $value && length $value or '-' eq $value or not $value =~ /^-/
195 0 0 if $value ne '--'
197 0 0 unless @ARGV
236 9 59 unless (defined $arg)
237 4 5 if wantarray
241 1 58 unless @rules
244 36 22 unless ref $arg
245 1 57 unless $opt =~ /$pattern/
249 1 55 if exists $self->{'longOptions'}{$rule->long}
251 34 21 if (defined $rule->short)
253 1 33 if exists $self->{'shortOptions'}{$rule->short}
257 4 50 if (defined $rule->default)
262 13 41 if wantarray
265 22 3 unless wantarray
282 10 0 unless @missing
285 0 0 $one ? :
289 0 0 $one ? :
297 18 0 unless $rule->required
298 0 0 unless $rule->is_unused
299 0 0 unless $rule->context
302 0 0 if $context{$_}
313 1 2 if (defined $message) { }
338 4 13 unless (defined $rule)
345 1 12 if $rule->negatable
347 11 2 if (defined $rule->short) { }
355 3 10 if defined $rule->type
357 12 1 if $USAGE_OPTIONS_LENGTH > ($len = length($line) + 2)
368 0 3 if 0 != $have_required
380 16 7 if ($len < $nChars)
386 1 6 if (-1 == $pos) { }
395 3 13 if (@lines > 1)
409 6 126 if $find eq substr($string, $pos, $length)
439 35 22 if exists $options{'short'}
443 8 49 if ($options{'multiple'}) { }
22 27 elsif ($options{'type'}) { }
449 6 16 if $rule{'is_list'}
455 55 2 unless $rule{'help'} =~ /[.]$/
457 22 35 if (@$arg)
458 7 15 if 'CODE' eq ref $arg->[0]
460 1 21 if 0 != @$arg % 2
467 0 56 if ($rule{'required'})
468 0 0 if exists $rule{'default'}
469 0 0 unless exists $rule{'type'}
472 2 54 if (defined $rule{'context'})
502 0 13 $self->required ? :
505 2 1 do { '?' ne $self->{'type'} } ? :
3 10 defined $self->{'type'} ? :
508 2 0 unless $show_default and defined $self->{'default'}
515 0 1 $show_default && defined $self->{'default'} ? :