Branch Coverage

blib/lib/Getopt/OO.pm
Criterion Covered Total %
branch 201 232 86.6


line true false branch
510 10 6 if (defined $_[0] and @_ == 1 and $_[0] =~ /^[01]$/ || ref $_[0] && ref $_[0] eq 'IO::File') { }
2 6 elsif ($$enabled_ref and @_) { }
516 2 8 if (ref $_[0]) { }
524 0 2 if ($_[0] =~ /\%\d*[sdfcx]/i) { }
556 7 21 if ($$template{$option}{'n_values'})
558 2 7 $i ? :
562 18 58 @options ? :
571 1 10 if ($$template{$option}{'n_values'})
574 0 1 $i ? :
577 6 5 if ($$template{$option}{'multi_value'})
581 9 67 @options ? :
589 5 33 exists $$template{'required'} ? :
610 17 21 if ($$template{'other_values'})
612 16 1 if (ref $ref and ref $ref eq 'HASH')
613 2 3 $$ref{'n_values'} == 2 ? :
5 5 $$ref{'n_values'} == 1 ? :
1 10 !($$ref{'n_values'} =~ /^\d+$/) ? :
11 2 $$ref{'n_values'} ? :
1 13 $$ref{'multi_value'} ? :
2 14 $$ref{'help'} ? :
631 15 23 $short_optional_arg_list ? :
8 30 $long_optional_arg_list ? :
3 35 $short_required_arg_list ? :
1 37 $long_required_arg_list ? :
641 0 38 if ($$template{'usage'})
644 0 0 ref $$template{'usage'} ? :
648 5 33 if (%required)
650 2 3 @r > 1 ? :
654 3 35 if (my $mutual_exclusive = $$template{'mutual_exclusive'})
655 3 0 if (ref $$mutual_exclusive[0]) { }
666 3 35 if (my(@m) = grep((/^-/ && $$template{$_}{'multiple'}), keys %$template))
667 1 2 @m > 1 ? :
681 3 10 if ($$template{$_}{'n_values'}) { }
2 8 elsif ($$template{$_}{'multi_value'}) { }
683 0 3 $i > 1 ? :
690 6 7 if length $options > $max_len
706 0 13 ref $$template{$key}{'help'} ? :
724 17 19 if (defined $$template{'other_values'})
726 16 1 if (ref $ref and ref $ref eq 'HASH') { }
731 1 15 if (my(@bad) = grep((!$valid_tags{$_}), keys %$ref)) { }
1 14 elsif ($$ref{'multi_value'}) { }
1 16 elsif ($$ref{'n_values'} and not $$ref{'n_values'} =~ /^\d+/) { }
745 13 4 unless @errors
750 3 22 if ($option eq 'mutual_exclusive') { }
5 17 elsif ($option eq 'required') { }
751 0 3 unless (ref $ref eq 'ARRAY')
757 0 5 unless (ref $ref and ref $ref eq 'ARRAY')
761 4 21 if @errors
764 1 37 if ($option =~ /^-[a-zA-Z]\w+/)
773 0 37 if (@bad) { }
779 8 24 if ($key eq 'n_values')
780 0 8 unless ($$ref{'n_values'} =~ /^\d+$/)
787 9 23 if ($$ref{'multi_value'})
788 9 0 if ($option =~ /^--/) { }
789 0 9 if (my(@b) = grep(/^(n_values)$/, keys %$ref))
799 0 32 if @errors
802 37 0 unless @errors
804 5 31 @errors ? :
815 10 17 $$argv[0] =~ /^--/ ? :
821 31 0 if ($$template{$option}) { }
826 1 30 if (exists $$this{$option}{'exists'} and not $$ref{'multiple'}) { }
7 23 elsif (my $n_values = $$ref{'n_values'}) { }
6 17 elsif ($$this{$option}{'multi_value'}) { }
839 3 4 if ($n_values > 1) { }
842 6 0 if (@$argv) { }
852 2 1 if ($$ref{'multiple'}) { }
862 2 2 $$this{$option}{'multiple'} ? :
4 0 @$argv ? :
873 5 1 if (@$argv) { }
874 5 0 if $$argv[0] eq '-'
875 2 3 if ($$this{$option}{'multiple'}) { }
876 1 1 unless (exists $$this{$option}{'values'})
895 2 29 if (not @errors and $$ref{'callback'})
896 1 1 if (my $error = &{$$ref{'callback'};}($this, $option))
907 3 24 if @errors
912 14 17 if @$argv
913 13 18 if ($$template{'other_values'} and not @errors)
915 1 12 if (exists $$ref{'n_values'} and $$ref{'n_values'} == 0 and @$argv) { }
921 2 10 if ($n and @$argv and $n != @$argv) { }
927 4 6 $n == 1 ? :
931 3 9 if (not @errors and $$ref{'callback'})
932 1 2 if (my $error = &{$$ref{'callback'};}($this, 'other_values'))
946 0 38 if (not ref $_[0] or ref $_[0] ne 'ARRAY') { }
953 0 38 unless (@_ & 1)
958 38 0 unless @errors
965 1 37 if (my(@bad) = grep((!(/^-/ || $valid{$_})), keys %template))
969 37 1 unless (@errors)
975 1 36 if (my(@bad) = grep(($i++ && $keys{$_}++), @_))
979 36 2 unless (@errors)
987 31 7 unless (@errors)
989 31 0 exists $$this{'errors'} ? :
992 24 14 unless (@errors)
994 5 19 $template{'required'} ? :
996 5 19 if (%required)
1005 2 3 unless (@r and @r == scalar keys %required)
1013 22 16 unless (@errors)
1014 3 19 if (exists $template{'mutual_exclusive'})
1015 3 0 if (ref $template{'mutual_exclusive'}) { }
1018 3 0 if (ref $mutual_exclusive[0]) { }
1021 1 2 if ((my(@bad) = grep($check_hash{$_}, @options)) > 1)
1030 0 0 if ((my(@bad) = grep($check_hash{$_}, @options)) > 1)
1042 17 21 if (@errors)
1058 18 6 if ($key) { }
1059 18 0 if (exists $$this{$key}) { }
1061 16 2 if (exists $$ref{'values'}) { }
1062 4 12 if ($$ref{'multi_value'}) { }
7 5 elsif ($$ref{'n_values'}) { }
1066 2 5 if ($$ref{'multiple'}) { }
1 4 elsif ($$ref{'n_values'} == 1) { }
1081 2 0 ref $$ref{'values'} && ref $$ref{'values'} eq 'ARRAY' ? :
2 3 wantarray ? :
1097 1 5 if $$this{'other_values'}{'exists'}
1098 5 1 @rv ? :
1104 3 0 if ($option and $$this{$option}) { }
1105 1 2 if @_ == 3
1110 2 1 exists $$this{$option}{'client_data'} ? :