Branch Coverage

blib/lib/Smart/Options.pm
Criterion Covered Total %
branch 104 114 91.2


line true false branch
31 56 3 if ($opt{'add_help'} // 1)
107 7 10 if $val eq $option
110 14 6 length $_ == 1 ? :
118 7 10 if $val eq $option
121 7 6 $desc ? :
129 8 10 if $val eq $option
145 6 0 if (scalar keys %$demand or scalar keys %$describe)
148 4 13 if $$alias{$opt}
149 1 12 $$boolean{$opt} ? :
5 8 $$demand{$opt} ? :
1 12 $self->_get_default($opt) ? :
162 1 5 if (keys %{$$self{'subcmd'};})
182 5 75 if ($k) { }
8 67 elsif (exists $$argv{$key}) { }
187 2 6 if (ref $$argv{$key}) { }
212 4 8 if $line =~ /^\[/
213 2 6 if $line =~ /^;/
214 0 6 unless $line =~ /=/
217 6 0 if ($line =~ /^(.+?[^\\])=(.*)$/)
225 33 28 unless @_
235 20 124 if ($stop)
239 49 75 if ($arg =~ /^--((?:\w|-|\.)+)=(.+)$/) { }
37 38 elsif ($arg =~ /^(-(\w(?:\w|-|\.)*)|--((?:\w|-|\.)+))$/) { }
4 34 elsif ($arg =~ /^--$/) { }
242 4 45 if ($k) { }
249 2 35 if ($key)
255 3 34 if ($$boolean{$option}) { }
256 0 3 if ($k) { }
274 26 8 if ($key) { }
275 1 25 if ($nest_key) { }
284 1 7 if (not scalar @args and keys %{$$self{'subcmd'};})
285 1 0 if ($$self{'subcmd'}{$arg}) { }
299 6 55 if ($key)
300 0 6 if ($nest_key) { }
308 1 60 if (my $parser = $$self{'subcmd'}{$$argv{'command'} or ''}) { }
316 1 5 if (ref $val and ref $val eq 'CODE') { }
325 43 30 if $val ne 'Config'
326 28 2 unless $$argv{$key} and -f $$argv{$key}
332 3 5 unless ($$argv{$opt})
342 5 64 if (my $c = $$self{'coerce'}{$type})
347 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') { }
349 0 0 $$argv{$opt} =~ /^(0|1)$/ ? :
353 18 1 if ($$argv{$opt}) { }
354 15 3 $$argv{$opt} =~ /^\-?\d+$/ ? :
359 5 2 if ($$argv{$opt}) { }
360 4 1 $$argv{$opt} =~ /^\-?\d+(\.\d+)$/ ? :
366 2 8 unless (ref $$argv{$opt})
369 9 1 ref $$argv{$opt} eq 'ARRAY' ? :
372 1 1 ref $$argv{$opt} eq 'HASH' ? :
374 0 28 if ($$argv{$opt} and not -f $$argv{$opt})
381 6 63 unless ($check)
386 1 51 if ($$argv{'help'} and $$self{'add_help'})