Branch Coverage

blib/lib/Getopt/Guided.pm
Criterion Covered Total %
branch 63 66 95.4


line true false branch
36 1 11 @_ == 1 ? :
48 1 37 unless grep {$function eq $_;} @EXPORT_OK
58 35 29 unless defined $spec_as_hash
65 1 114 if exists $spec_as_hash->{$name}
70 6 57 unless defined $offset and $offset == length $spec
72 1 56 if defined $spec_length_expected and $spec_length_got != $spec_length_expected
82 15 35 ref $spec eq 'HASH' ? :
83 1 43 if %$opts
85 26 17 unless defined $argv
92 1 122 if $argv->[0] eq "--"
95 4 118 unless exists $spec_as_hash->{$name}
98 55 63 if ($indicator =~ /\A ${\'[,:]';} \z/ox) { }
104 6 49 if ($rest ne '') { }
108 2 47 unless @$argv
111 1 46 unless defined($value = shift @$argv)
115 31 21 if ($indicator eq ':') { }
120 10 11 unless exists $opts->{$name}
125 45 18 if (not exists $opts->{$name}) { }
1 17 elsif ($indicator eq '!') { }
14 3 elsif ($indicator eq '+') { }
136 47 16 if ($rest eq '') { }
146 7 36 if (@error)
178 2 13 unless &getopts($spec_as_hash, \my %opts, \@$argv)
185 16 2 if (exists $opts{$name})
189 4 12 if ($dest_ref_type eq 'SCALAR') { }
1 11 elsif ($dest_ref_type eq 'ARRAY' and $indicator eq ',') { }
10 1 elsif ($dest_ref_type eq 'CODE') { }
199 4 6 if (&$dest($value, $name, $indicator) // "") eq "--"
216 1 1 unless -f (my $file = File::Spec::Functions::catfile($ENV{'XDG_CONFIG_HOME'}, &program_name() . 'rc'))
218 0 1 unless open my $fh, "<:encoding(UTF-8)", $file
223 0 2 if /\A (?: \#.* | ) \z/x
224 2 0 if (/\A ( [[:alnum:]] ) (?: \ ( .+ ) )? \z/x)
225 1 1 defined $2 ? :