Branch Coverage

blib/lib/Getopt/Tree.pm
Criterion Covered Total %
branch 95 160 59.3


line true false branch
342 0 43 unless ($$param_ref{'name'})
343 0 43 if ($$param_ref{'name'} =~ /[=|\@]/)
344 0 43 if ($$param_ref{'name'} =~ /^-/)
345 26 17 if ($$param_ref{'abbr'}) { }
346 0 26 if ($$param_ref{'abbr'} =~ /[-=|]@/)
347 0 26 if ($$param_ref{'abbr'} =~ /^-/)
352 1 42 if ($$param_ref{'multi'}) { }
17 25 elsif (not $$param_ref{'exists'}) { }
358 12 31 if ($$param_ref{'params'})
371 4 4 if ($$top_level{'exists'})
372 0 4 if ($$top_level{'multi'})
373 0 0 if (ref $v eq 'ARRAY') { }
382 3 1 if ($$top_level{'re'})
383 0 3 if ($$top_level{'multi'}) { }
385 0 0 if (ref $v eq 'ARRAY') { }
388 0 0 unless (defined $1)
397 0 3 unless (defined $1)
401 1 3 if ($$top_level{'eval'})
403 0 1 unless (defined $v)
422 0 35 if ($$top_level{'params'} and $$top_level{'leaf'})
425 13 0 unless ($$top_level{'optional'} or $$top_level{'leaf'})
429 8 27 if (defined $$g_opts{$$top_level{'name'}})
431 1 7 if ($$top_level{'optional'}) { }
0 7 elsif ($$top_level{'leaf'}) { }
433 0 1 unless ($status)
438 0 0 unless ($status)
443 0 7 if ($this_level)
451 0 7 unless ($status)
455 6 2 if ($$top_level{'params'} and not $$top_level{'leaf'})
457 0 6 unless ($status)
463 0 0 unless ($matched_leaves{$$l{'name'}})
471 0 7 unless ($this_level or $this_level_is_a_leaf)
495 0 4 if (not $SWITCH_PREFIX_STR or $SWITCH_PREFIX_STR ne '-')
500 4 0 if (not defined $source) { }
0 0 elsif (not ref $source) { }
512 0 4 unless defined $op
520 4 0 if ($SWITCH_PREFIX_STR)
524 0 28 unless ($$known_ops{'name'})
525 4 24 if ($op eq $$known_ops{'name'} or $$known_ops{'abbr'} and $op eq $$known_ops{'abbr'})
528 0 4 if ($$known_ops{'optional'} or $$known_ops{'leaf'})
529 0 0 unless ($$known_ops{'exists'})
540 0 0 unless ($op_ref)
546 0 4 unless ($op)
552 20 16 unless $$optional_ops{'optional'} or $$optional_ops{'leaf'}
553 0 16 unless ($$optional_ops{'name'})
557 4 0 if (@global_options)
562 0 0 if ($k =~ /^\Q$root\E/)
563 0 0 if ($k ne $p)
577 0 4 unless $getopt_success
583 0 4 unless $status
585 4 0 if (@global_options)
587 0 4 unless $status
598 0 8 unless (exists $good_values{$k})
604 0 4 unless ($all_good)
614 1 8 unless (defined $depth)
619 15 8 if ($$top_level{'abbr'})
622 12 11 if ($$top_level{'optional'})
625 10 13 unless ($$top_level{'exists'})
629 5 18 if ($this_length > $param_length)
632 8 15 if ($$top_level{'params'})
641 1 8 unless (defined $depth)
645 0 9 unless ref $params eq 'ARRAY'
650 21 9 if (($$a{'optional'} || 0) == ($$b{'optional'} || 0)) { }
654 3 6 if ($$a{'optional'})
655 6 0 if ($$b{'optional'})
663 15 8 if ($$top_level{'abbr'})
668 10 13 unless ($$top_level{'exists'})
671 12 11 if ($$top_level{'optional'})
680 8 15 if ($$top_level{'params'})
702 0 1 if (not defined $fh_or_options) { }
0 1 elsif (ref $fh_or_options eq 'HASH') { }
710 1 0 if ($$options{'fh'} and not $$options{'wrap_at'})
711 0 1 if (-t $$options{'fh'} and defined $ENV{'COLUMNS'})
715 1 0 unless ($$options{'wrap_at'} and $$options{'wrap_at'} =~ /^\d{1,4}$/)
724 0 9 if ($$p{'leaf'})
731 1 0 unless ($$options{'hide_top_line'})
735 1 0 if ($USAGE_HEADER)
741 1 0 if ($USAGE_FOOTER)
745 1 0 if ($$options{'fh'})
746 0 1 if ($$options{'return'})