Branch Coverage

blib/lib/Smart/Options.pm
Criterion Covered Total %
branch 112 124 90.3


line true false branch
33 59 3 if ($opt{'add_help'} // 1)
111 7 10 if $val eq $option
114 14 6 length $_ == 1 ? :
122 7 10 if $val eq $option
125 7 6 $desc ? :
133 8 10 if $val eq $option
149 6 0 if (scalar keys %$demand or scalar keys %$describe)
152 4 13 if $alias->{$opt}
157 1 12 $boolean->{$opt} ? :
5 8 $demand->{$opt} ? :
1 12 $self->_get_default($opt) ? :
166 1 5 if (keys %{$$self{'subcmd'};})
186 5 76 if ($k) { }
8 68 elsif (exists $argv->{$key}) { }
191 2 6 if (ref $argv->{$key}) { }
216 4 8 if $line =~ /^\[/
217 2 6 if $line =~ /^;/
218 0 6 unless $line =~ /=/
221 6 0 if ($line =~ /^(.+?[^\\])=(.*)$/)
229 34 30 unless @_
239 20 127 if ($stop)
243 50 77 if ($arg =~ /^--((?:\w|-|\.)+)=(.+)$/) { }
37 40 elsif ($arg =~ /^(-(\w)|--((?:\w|-|\.)+))$/) { }
2 38 elsif ($arg =~ /^-(\w(?:\w|-|\.)+)$/) { }
4 34 elsif ($arg =~ /^--$/) { }
246 4 46 if ($k) { }
253 2 35 if ($key)
257 1 36 if ($opt =~ /^no\-(.+)$/)
264 3 33 if ($boolean->{$option}) { }
265 0 3 if ($k) { }
278 0 2 if ($key)
282 1 1 if ($opt_str =~ /^(.)([0-9])+$/) { }
298 26 8 if ($key) { }
299 1 25 if ($nest_key) { }
308 1 7 if (not scalar @args and keys %{$$self{'subcmd'};})
309 1 0 if ($self->{'subcmd'}{$arg}) { }
323 6 58 if ($key)
324 0 6 if ($nest_key) { }
332 1 63 if (my $parser = $self->{'subcmd'}{$argv->{'command'} or ''}) { }
339 2 1 if (defined $ENV{uc $self->{'env_prefix'} . "_$env"})
347 1 6 if (ref $val and ref $val eq 'CODE') { }
356 43 30 if $val ne 'Config'
357 28 2 unless $argv->{$key} and -f $argv->{$key}
363 3 4 unless ($argv->{$opt})
373 5 63 if (my $c = $self->{'coerce'}{$type})
378 0 68 if ($type eq 'Bool') { }
3 65 elsif ($type eq 'Str') { }
19 46 elsif ($type eq 'Int') { }
7 39 elsif ($type eq 'Num') { }
10 29 elsif ($type eq 'ArrayRef') { }
2 27 elsif ($type eq 'HashRef') { }
380 0 0 $argv->{$opt} =~ /^(0|1)$/ ? :
384 18 1 if ($argv->{$opt}) { }
385 15 3 $argv->{$opt} =~ /^\-?\d+$/ ? :
390 5 2 if ($argv->{$opt}) { }
391 4 1 $argv->{$opt} =~ /^\-?\d+(\.\d+)$/ ? :
397 2 8 unless (ref $argv->{$opt})
400 9 1 ref $argv->{$opt} eq 'ARRAY' ? :
403 1 1 ref $argv->{$opt} eq 'HASH' ? :
405 0 27 if ($argv->{$opt} and not -f $argv->{$opt})
412 6 62 unless ($check)
417 1 0 if ($argv->{'help'} and $self->{'add_help'})