Branch Coverage

blib/lib/Data/EDI/X12.pm
Criterion Covered Total %
branch 106 160 66.2


line true false branch
245 0 2 if ($args->{'spec'}) { }
0 2 elsif ($args->{'yaml_spec'}) { }
2 0 elsif ($args->{'spec_file'}) { }
269 0 0 if $spec->{'config'} and $spec->{'config'}{'config_terminator'}
273 0 0 if $spec->{'config'} and $spec->{'config'}{'config_separator'}
277 0 0 if $spec->{'config'} and exists $spec->{'config'}{'strict_ascii'}
281 0 0 if $spec->{'config'} and exists $spec->{'config'}{'truncate_null'}
285 0 0 if $spec->{'config'} and exists $spec->{'config'}{'hide_empty_sections'}
318 2 0 unless $self->{'terminator'} =~ /[\r\n]/
377 0 32 unless $definition
383 131 23 if $def->{'name'}
411 2 0 unless exists $record->{'GROUPS'}
417 2 36 if ($type eq 'ISA') { }
2 34 elsif ($type eq 'IEA') { }
2 32 elsif ($type eq 'GS') { }
2 30 elsif ($type eq 'GE') { }
2 28 elsif ($type eq 'ST') { }
2 26 elsif ($type eq 'SE') { }
521 0 78 unless $spec->{'structure'}{$section}
523 34 182 if (ref $segment and ref $segment eq 'HASH') { }
541 10 16 if ($section eq 'DETAIL') { }
0 16 elsif ($section eq 'HEADER' and $IN_DETAIL) { }
3 13 elsif ($section eq 'FOOTER') { }
0 26 elsif ($section eq 'DETAIL' and $IN_FOOTER) { }
563 26 0 if (my $type_def = $spec->{'segments'}{uc $type})
565 12 14 if ($section eq 'DETAIL' or $LOOP_SECTION eq 'DETAIL') { }
568 2 10 unless exists $current_record->{'DETAIL'}
571 1 11 if ($loop_def{$type} and not $IN_LOOP)
575 0 1 unless $loop_def{$type}
579 1 11 if ($IN_LOOP and not $LOOP_SEGMENTS{$type})
586 4 8 if ($IN_LOOP) { }
589 1 3 unless exists $current_record->{'DETAIL'}[-1]{$IN_LOOP}
592 1 3 if exists $current_record->{'DETAIL'}[-1]{$IN_LOOP}[-1]{$type}
603 2 6 if exists $current_record->{'DETAIL'}[-1]{$type}
615 5 9 unless exists $current_record->{$section}
620 1 13 if ($IN_LOOP and not $LOOP_SEGMENTS{$type})
628 1 13 if ($loop_def{$type} and not $IN_LOOP)
632 0 1 unless $loop_def{$type}
636 4 10 if ($IN_LOOP) { }
639 1 3 unless exists $current_record->{$LOOP_SECTION}{$IN_LOOP}
642 1 3 if exists $current_record->{$LOOP_SECTION}{$IN_LOOP}[-1]{$type}
674 0 38 unless $type_def->{'definition'}
676 0 166 unless ref $record eq 'HASH'
679 143 23 $def->{'name'} && exists $$record{$def->{'name'}} ? :
681 20 146 unless defined $value
687 0 96 if $value ne '' and not $def->{'bytes'} and $def->{'min'} and length $value < $def->{'min'}
690 48 118 if $def->{'bytes'}
696 68 98 if $def->{'max'}
699 142 24 if $value
700 142 24 if $value
703 0 166 if $self->{'strict_ascii'}
709 38 0 if ($self->{'truncate_null'})
713 38 3 if $val ne ''
721 38 0 if $self->{'new_lines'}
743 0 2 unless exists $record->{'ISA'}{'control_number'}
754 0 2 unless $record->{'GROUPS'}
758 0 2 unless exists $group->{'control_number'}
769 0 2 unless $group->{'SETS'}
774 0 2 if ($self->{'spec'}{'RECORD_OFFSET_COUNT'})
782 0 2 unless exists $set->{'control_number'}
796 0 2 unless $spec
800 0 2 unless $spec->{'structure'}{'header'}
802 1 7 if (ref $section and ref $section eq 'HASH') { }
807 0 1 unless $set->{'HEADER'}{$loop_name}
809 0 2 unless $loop_structure
811 0 4 if $hide_empty_sections and not exists $record->{$structure}
825 0 7 if $hide_empty_sections and not exists $set->{'HEADER'}{$section}
837 0 2 unless $set->{'DETAIL'}
839 0 4 unless $spec->{'structure'}{'detail'}
841 2 8 if (ref $section and ref $section eq 'HASH') { }
846 1 1 unless $detail->{$loop_name}
848 0 2 unless $loop_structure
850 0 4 if $hide_empty_sections and not exists $sub_record->{$structure}
863 0 8 if $hide_empty_sections and not exists $detail->{$section}
877 0 2 unless $spec->{'structure'}{'footer'}
879 0 3 if (ref $section and ref $section eq 'HASH') { }
884 0 0 unless $set->{'FOOTER'}{$loop_name}
886 0 0 unless $loop_structure
888 0 0 if $hide_empty_sections and not exists $record->{$structure}
901 0 3 if $hide_empty_sections and not exists $set->{'FOOTER'}{$section}