Branch Coverage

blib/lib/Getopt/O2.pm
Criterion Covered Total %
branch 129 138 93.4


line true false branch
25 1 26 ref $_[0] ? :
48 5 41 if (not defined $arg && length $arg or '-' eq $arg or not $arg =~ /^-/) { }
2 39 elsif ('--' eq $arg) { }
56 14 25 if (not $arg =~ /^--/) { }
59 1 13 unless defined $rule
63 5 8 if (length $arg > 2)
64 1 4 if ($rule->type) { }
73 1 24 if (~index($key, '='))
79 5 20 unless (defined $rule)
80 2 3 if 0 != index($key, 'no-')
85 2 1 unless defined $rule and $rule->negatable
91 1 33 if (defined $rule->context)
94 1 0 unless exists $context{$_}
101 3 30 if ($rule->multiple) { }
6 24 elsif (not defined $rule->type) { }
103 1 2 unless exists $self->{'options'}{$rule->long}
110 2 22 unless defined $arg
113 14 8 if $rule->is_unused
118 5 17 if $rule->is_list and not defined $self->{'options'}{$rule->long}
125 1 1 unless &looks_like_number($arg)
132 1 8 unless $rule->values
2 7 unless $arg ~~ \@{[] unless $rule->values;}
136 13 6 if ($rule->is_list)
137 7 6 if ('?' ne $rule->type) { }
141 5 1 unless $rule->keep_unique and $arg ~~ \@{$self->{'options'}{$rule->long};}
147 1 11 if (defined $rule->action) { }
150 1 4 $rule->{'_negate'} ? :
5 6 unless defined $arg
158 2 8 if ref $args
172 5 0 if 'perl' eq $program
184 1 23 unless @ARGV
187 21 0 if not defined $value && length $value or '-' eq $value or not $value =~ /^-/
188 0 0 if $value ne '--'
190 0 0 unless @ARGV
229 9 59 unless (defined $arg)
230 4 5 if wantarray
234 1 58 unless @rules
237 36 22 unless ref $arg
238 1 57 unless $opt =~ /$pattern/
242 1 55 if exists $self->{'longOptions'}{$rule->long}
244 34 21 if (defined $rule->short)
246 1 33 if exists $self->{'shortOptions'}{$rule->short}
250 4 50 if (defined $rule->default)
255 13 41 if wantarray
258 22 3 unless wantarray
272 1 2 if (defined $message) { }
296 4 13 unless (defined $rule)
303 1 12 if $rule->negatable
305 11 2 if (defined $rule->short) { }
313 3 10 if defined $rule->type
315 12 1 if $USAGE_OPTIONS_LENGTH > ($len = length($line) + 2)
336 16 6 if ($len < $nChars)
342 1 5 if (-1 == $pos) { }
351 3 13 if (@lines > 1)
365 5 88 if $find eq substr($string, $pos, $length)
395 35 22 if exists $options{'short'}
397 4 53 if $options{'negatable'}
398 8 49 if ($options{'multiple'}) { }
22 27 elsif ($options{'type'}) { }
404 6 16 if $rule{'is_list'}
410 55 2 unless $rule{'help'} =~ /[.]$/
412 22 35 if (@$arg)
413 7 15 if 'CODE' eq ref $arg->[0]
415 1 21 if 0 != @$arg % 2
420 2 54 if (defined $rule{'context'})
451 2 1 do { '?' ne $self->{'type'} } ? :
3 10 defined $self->{'type'} ? :
456 2 0 unless $show_default and defined $self->{'default'}
463 0 1 $show_default && defined $self->{'default'} ? :