Branch Coverage

blib/lib/Test/CPAN/Meta/JSON/Version.pm
Criterion Covered Total %
branch 124 146 84.9


line true false branch
450 33 35 unless ($$self{'spec'})
451 29 4 $$data{'meta-spec'} && $$data{'meta-spec'}{'version'} ? :
455 31 37 defined $$self{'errors'} ? :
460 29 61 unless $$self{'errors'}
489 1 709 if (ref $spec ne 'HASH')
494 8 701 if (ref $data ne 'HASH')
500 1601 671 unless $$spec{$key}{'mandatory'}
501 653 18 if defined $$data{$key}
509 1232 1054 if ($$spec{$key}) { }
1054 0 elsif ($$spec{':key'}) { }
510 712 520 if ($$spec{$key}{'value'}) { }
346 174 elsif ($$spec{$key}{'map'}) { }
128 46 elsif ($$spec{$key}{'list'}) { }
46 0 elsif ($$spec{$key}{'lazylist'}) { }
524 770 284 if ($$spec{':key'}{'value'}) { }
284 0 elsif ($$spec{':key'}{'map'}) { }
0 0 elsif ($$spec{':key'}{'list'}) { }
0 0 elsif ($$spec{':key'}{'lazylist'}) { }
0 0 elsif (not $$spec{':key'}{'name'}) { }
546 0 46 if (defined $data and not ref $data)
556 10 176 if (ref $data ne 'ARRAY')
561 0 176 if (defined $$spec{'mandatory'})
562 0 0 unless (defined $$data[0])
569 281 0 if (defined $$spec{'value'}) { }
0 0 elsif (defined $$spec{'map'}) { }
0 0 elsif (defined $$spec{'list'}) { }
0 0 elsif (defined $$spec{'lazylist'}) { }
0 0 elsif ($$spec{':key'}) { }
696 102 12 if ($value) { }
699 12 90 unless ($scheme)
703 14 76 unless ($auth)
717 57 5 if (defined $value)
718 37 20 if $value and $known_specs{$$self{'spec'}} eq $value
719 10 10 if ($value and $known_urls{$value})
730 525 6 if (defined $value)
731 519 6 if $value or $value =~ /^0$/
739 6 18 unless defined $value
740 12 6 if $value or $value =~ /^0$/
747 82 6 if defined $value
754 717 6 if (defined $value and $value || $value =~ /0/)
756 6 741 unless $self->version($key, $_)
759 12 6 unless defined $value
766 989 12 if (defined $value) { }
767 6 983 unless $value or $value =~ /0/
768 969 14 if $value =~ /^\s*((<|<=|>=|>|!=|==)\s*)?v?\d+((\.\d+((_|\.)\d+)?)?)/
778 58 12 if (defined $value) { }
779 46 12 if $value =~ /^(0|1|true|false)$/
837 133 53 $$self{'spec'} < 2 ? :
838 180 6 if (defined $value) { }
839 167 13 if $value and exists $$licenses{$value}
843 5 8 if $value and $$self{'spec'} < 2
853 37 6 if (defined $key) { }
856 24 7 if $key and $key =~ /^[a-z]+$/i and $key =~ /[A-Z]/
866 119 6 if (defined $key) { }
867 83 36 if $key and $key =~ /^([a-z][-_a-z]*)$/
868 6 30 if $key and $key =~ /^x_([a-z][-_a-z]*)$/i
878 82 6 if (defined $key) { }
879 58 24 if $key and $key =~ /^([a-z][_a-z]+)$/i
889 797 6 if (defined $key) { }
890 779 18 if $key and $key =~ /^[A-Za-z0-9_]+(::[A-Za-z0-9_]+)*$/
900 35 1 if (defined $value) { }
902 3 32 if ($version =~ /_/) { }
903 2 1 if $value =~ /\A(?:testing|unstable)\z/
906 28 4 if $value =~ /\A(?:stable|testing|unstable)\z/
917 10 1 if (defined $key) { }
920 2 7 if $key and $key =~ /^[a-z]+$/i and $key =~ /[A-Z]/
930 19 1 if (defined $key) { }
933 2 17 if $key and $key =~ /^x_([a-z][-_a-z]*)$/i
944 93 1 if (defined $key) { }
945 85 8 if length $key and grep {$key eq $_;} @valid_phases
956 114 1 if (defined $key) { }
957 106 8 if length $key and grep {$key eq $_;} @valid_relations
971 69 297 if $$self{'stack'}