Branch Coverage

blib/lib/Getopt/Yath/Option.pm
Criterion Covered Total %
branch 94 152 61.8


line true false branch
83 0 16 unless $class eq __PACKAGE__
85 0 16 unless my $type = delete $params{'type'}
96 377 12 unless $env
101 10 9 unless exists $ENV{$env}
102 7 2 unless $neg
103 1 1 $ENV{$env} ? :
119 0 833 if $self->{'maybe'} and $field eq "initialize"
121 539 294 unless exists $self->{$field}
123 226 68 unless ref $val
124 0 68 unless ref $val eq "CODE"
133 34 0 unless my $cb = $self->{'normalize'}
139 465 66 unless my $cb = $self->{'trigger'}
152 503 0 unless my $cb = $self->{'applicable'}
159 0 0 unless $self->{'alt'}
164 0 0 unless my $trace = $self->{'trace'}
170 0 28 if $self->{'long_examples'}
176 0 16 if $self->{'short_examples'}
184 0 16 unless $self->{'trace'}
187 0 15 unless $self->{'module'} or $self->{'no_module'}
190 0 0 unless $self->{'title'} or $self->{'field'} and $self->{'name'}
193 0 16 unless $self->{'group'}
196 0 16 if $self->{'set_env_vars'} and not $self->can_set_env
199 0 16 if $self->{'alt'} and ref $self->{'alt'} ne "ARRAY"
202 0 16 if $self->{'alt_no'} and ref $self->{'alt_no'} ne "ARRAY"
204 1 15 unless $self->{'no_module'}
206 16 0 if (my $title = $self->{'title'})
214 16 0 unless ($self->allow_underscore_in_alt)
216 3 0 unless $alt =~ /_/
222 0 0 $self->allows_autofill ? :
0 16 if $self->{'default'} and not $self->allows_default
224 1 15 if $self->requires_autofill and not $self->{'autofill'}
225 0 15 if $self->{'autofill'} and not $self->allows_autofill
228 33 12 unless my $val = $self->{$field}
229 6 6 unless my $ref = ref $val
230 0 6 if $ref and $ref ne "CODE"
234 44 1 unless my $val = $self->{$field}
236 1 0 if $ref eq "CODE"
244 0 156 unless $self->can(uc $key)
254 0 44 unless defined $val
256 0 44 unless ref $val eq "ARRAY"
258 44 0 unless my $av = $self->allowed_values
264 0 0 if ($r eq 'CODE') { }
0 0 elsif ($r =~ /Regex/i) { }
0 0 elsif ($r eq 'ARRAY') { }
273 0 0 unless defined $c
275 0 0 if $c eq $v
276 0 0 if 0 + $c and 0 + $v and $c == $v
282 0 0 if $ok
292 494 15 if $self->{'forms'}
296 8 7 if $self->{'short'}
299 0 15 if length $prefix
316 16 8 unless $self->allows_list
335 6 20 unless $self->allows_arg
337 12 8 if ($self->requires_arg)
348 2 4 unless $self->allows_arg
350 2 2 if ($self->requires_arg)
351 2 0 if $self->allows_shortval
355 2 0 if $self->allows_shortval
364 0 28 $self->{'prefix'} ? :
369 22 6 unless $self->{'alt'}
373 16 12 if (my $short = $self->{'short'})
383 0 59 unless $al <=> $bl
402 0 14 if ($params{'color'}) { }
421 2 12 if $self->{'from_env_vars'}
422 2 12 if $self->{'clear_env_vars'}
423 2 12 if $self->{'set_env_vars'}
425 14 0 if (my(@notes) = $self->notes)
427 5 14 if $_
433 6 6 if ref $val
437 0 14 if (my $avt = $self->allowed_values_text) { }
0 14 elsif (my $vals = $self->allowed_values) { }
441 0 0 if @$vals
457 2 12 if $self->{'from_env_vars'}
458 2 12 if $self->{'clear_env_vars'}
459 2 12 if $self->{'set_env_vars'}
462 5 14 if $_