Branch Coverage

blib/lib/Perinci/Sub/GetArgs/Argv.pm
Criterion Covered Total %
branch 189 232 81.4


line true false branch
50 1 0 if (eval {
58 1 0 if $cleanser
67 1 0 if (eval {
80 3 0 if ($yaml_xs_available) { }
85 0 0 unless $str =~ /\A--- /
86 0 0 unless $str =~ /\n\z/
104 0 184 unless my $clset = $nsch->[1]
105 182 2 unless my $rules = $clset->{'x.perl.coerce_rules'} // $clset->{'x.coerce_rules'}
108 0 2 unless $rule =~ /\A([^_]+)_/
109 2 0 if is_simple($1)
116 184 357 unless is_simple($nsch)
134 1 441 unless (is_type($nsch))
143 262 180 if $is_simple
145 100 80 if ($type eq "array")
147 36 64 unless $elnsch
152 1 63 unless (is_type($elnsch))
164 79 1 if ($type eq "hash")
166 44 35 unless $elnsch
171 1 34 unless (is_type($elnsch))
198 54 170 if ($is_array_of_simple or $is_hash_of_simple)
200 2 52 if ($arg_spec and $arg_spec->{'x.name.is_plural'}) { }
201 1 1 if ($arg_spec->{'x.name.singular'}) { }
212 35 19 $is_array_of_simple ? :
213 19 35 $is_hash_of_simple ? :
216 170 54 if ($is_simple or not @opts)
231 22 202 if ($type eq 'bool') { }
3 199 elsif ($type eq 'buf') { }
232 4 18 if (length $opt == 1) { }
2 16 elsif ($clset->{'is'} or $clset->{'is_true'}) { }
1 15 elsif (defined $clset->{'is'} and not $clset->{'is'} or defined $clset->{'is_true'} and not $clset->{'is_true'}) { }
262 2 180 $type eq 'float' ? :
17 182 $type eq 'int' ? :
19 145 $ishos ? :
35 164 $isaos ? :
288 8 190 $fqarg ne $arg ? :
290 0 0 unless $_ eq "hidden"
291 0 198 if grep {$_ eq "hidden-cli" unless $_ eq "hidden";} @{$arg_spec->{'tags'} // [];}
297 25 17 if ($type eq "array" and $clset->{'of'})
301 3 195 if ($seen_opts->{$opt})
305 0 3 $i > 1 ? :
306 3 0 unless $seen_opts->{$opt2}
332 5 71 if (ref $rargs eq 'ARRAY') { }
340 16 60 if ($is_array_of_simple) { }
7 53 elsif ($is_hash_of_simple) { }
352 5 71 if ($val_set and $arg_spec->{'cmdline_on_getopt'})
365 31 200 if ($extra->{'is_neg'}) { }
15 185 elsif (defined $extra->{'is_neg'}) { }
3 182 elsif ($extra->{'is_base64'}) { }
385 8 223 if ($parent_args->{'per_arg_json'} and not $is_simple)
387 0 8 if ($seen_opts->{$jopt}) { }
395 1 0 if ($success) { }
406 8 223 if ($parent_args->{'per_arg_yaml'} and not $is_simple)
408 0 8 if ($seen_opts->{$yopt}) { }
416 1 0 if ($success) { }
429 31 200 if ($arg_spec->{'cmdline_aliases'} and not $aliases_processed++)
433 5 30 $alspec->{'schema'} // $alspec->{'is_flag'} ? :
436 0 35 if ($seen_opts->{$alopt})
443 9 26 if ($alcode and $alsch->[0] eq 'bool') { }
451 12 23 if ($alcode) { }
452 3 9 if ($alcode eq "CODE")
453 1 2 if ($parent_args->{'ignore_converted_code'}) { }
471 0 3 if (ref $rargs eq 'ARRAY') { }
485 10 23 $alcode ? :
495 10 23 $alcode ? :
503 2 227 if ($arg_spec->{'meta'})
511 0 2 if $res
515 3 226 if ($arg_spec->{'element_meta'})
523 0 3 if $res
662 0 74 unless my $meta = $fargs{'meta'}
663 1 73 unless ($fargs{'meta_is_normalized'})
683 0 9 unless my $res = parse_getopt_long_opt_spec($ospec)
688 0 12 if $seen_opts{$_}
691 1 11 if ($res->{'is_neg'})
711 2 72 if $res
713 233 59 length $_ > 1 ? :
714 11 3 length $_ > 1 ? :
715 222 56 length $_ > 1 ? :
722 44 14 unless $seen_common_opts{$_} eq $ospec
723 11 3 length $_ > 1 ? :
731 222 56 length $_ > 1 ? :
936 0 73 unless my $meta = $fargs{'meta'}
937 73 0 unless ($fargs{'meta_is_normalized'})
962 2 71 if $genres->[0] != 200
969 1 70 unless $strict
970 70 1 $strict ? :
975 8 63 unless ($res)
976 8 0 if $strict
985 13 50 if (@$argv)
991 2 11 if ($res->[0] != 200 and $strict) { }
0 11 elsif ($strict and $res->[0] != 200) { }
10 1 elsif ($res->[0] == 200) { }
1000 2 9 if (exists $rargs->{$name})
1002 2 0 if $strict
1007 1 2 if ($arg_spec->{'slurpy'} // $arg_spec->{'greedy'} and ref $val eq "ARRAY" and not $is_array_of_simple and not $is_hash_of_simple)
1014 1 0 if ($per_arg_json)
1016 0 1 if ($success) { }
1023 1 0 if ($per_arg_yaml)
1025 1 0 if ($success) { }
1036 1 5 unless ($arg_spec->{'slurpy'} // $arg_spec->{'greedy'} or $is_simple)
1040 1 0 if ($per_arg_json)
1042 0 1 if ($success) { }
1049 1 0 if ($per_arg_yaml)
1051 1 0 if ($success) { }
1062 2 7 if ($arg_spec->{'cmdline_on_getopt'})
1063 2 0 if ($arg_spec->{'slurpy'} // $arg_spec->{'greedy'}) { }
1084 0 49 unless ($args_prop->{$a}{'pos'} // 9999) <=> ($args_prop->{$b}{'pos'} // 9999)
1087 68 76 unless (exists $rargs->{$arg})
1088 63 5 unless $arg_spec->{'req'}
1090 2 3 if ($on_missing)
1091 1 1 if &$on_missing("arg", $arg, "args", $rargs, "spec", $arg_spec)
1093 1 3 if exists $rargs->{$arg}
1100 1 58 unless $strict
1104 66 76 unless exists $rargs->{$arg}
1105 74 2 unless $arg_spec->{'deps'}
1107 0 2 unless $dep_arg
1110 1 1 unless exists $rargs->{$dep_arg}