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)
113 7 10 if $val eq $option
116 14 6 length $_ == 1 ? :
124 7 10 if $val eq $option
127 7 6 $desc ? :
135 8 10 if $val eq $option
151 6 0 if (scalar keys %$demand or scalar keys %$describe)
154 4 13 if $alias->{$opt}
159 1 12 $boolean->{$opt} ? :
5 8 $demand->{$opt} ? :
1 12 $self->_get_default($opt) ? :
168 1 5 if (keys %{$$self{'subcmd'};})
188 5 76 if ($k) { }
8 68 elsif (exists $argv->{$key}) { }
193 2 6 if (ref $argv->{$key}) { }
218 4 8 if $line =~ /^\[/
219 2 6 if $line =~ /^;/
220 0 6 unless $line =~ /=/
223 6 0 if ($line =~ /^(.+?[^\\])=(.*)$/)
231 34 30 unless @_
241 20 127 if ($stop)
245 50 77 if ($arg =~ /^--((?:\w|-|\.)+)=(.+)$/) { }
37 40 elsif ($arg =~ /^(-(\w)|--((?:\w|-|\.)+))$/) { }
2 38 elsif ($arg =~ /^-(\w(?:\w|-|\.)+)$/) { }
4 34 elsif ($arg =~ /^--$/) { }
248 4 46 if ($k) { }
255 2 35 if ($key)
259 1 36 if ($opt =~ /^no\-(.+)$/)
266 3 33 if ($boolean->{$option}) { }
267 0 3 if ($k) { }
280 0 2 if ($key)
284 1 1 if ($opt_str =~ /^(.)([0-9])+$/) { }
300 26 8 if ($key) { }
301 1 25 if ($nest_key) { }
310 1 7 if (not scalar @args and keys %{$$self{'subcmd'};})
311 1 0 if ($self->{'subcmd'}{$arg}) { }
325 6 58 if ($key)
326 0 6 if ($nest_key) { }
334 1 63 if (my $parser = $self->{'subcmd'}{$argv->{'command'} or ''}) { }
341 2 1 if (defined $ENV{uc $self->{'env_prefix'} . "_$env"})
349 1 6 if (ref $val and ref $val eq 'CODE') { }
358 43 30 if $val ne 'Config'
359 28 2 unless $argv->{$key} and -f $argv->{$key}
365 3 6 unless ($argv->{$opt})
375 5 64 if (my $c = $self->{'coerce'}{$type})
380 0 69 if ($type eq 'Bool') { }
3 66 elsif ($type eq 'Str') { }
19 47 elsif ($type eq 'Int') { }
7 40 elsif ($type eq 'Num') { }
10 30 elsif ($type eq 'ArrayRef') { }
2 28 elsif ($type eq 'HashRef') { }
382 0 0 $argv->{$opt} =~ /^(0|1)$/ ? :
386 18 1 if ($argv->{$opt}) { }
387 15 3 $argv->{$opt} =~ /^\-?\d+$/ ? :
392 5 2 if ($argv->{$opt}) { }
393 4 1 $argv->{$opt} =~ /^\-?\d+(\.\d+)$/ ? :
399 2 8 unless (ref $argv->{$opt})
402 9 1 ref $argv->{$opt} eq 'ARRAY' ? :
405 1 1 ref $argv->{$opt} eq 'HASH' ? :
407 0 28 if ($argv->{$opt} and not -f $argv->{$opt})
414 6 63 unless ($check)
419 1 0 if ($argv->{'help'} and $self->{'add_help'})