Branch Coverage

blib/lib/Data/EDI/X12.pm
Criterion Covered Total %
branch 108 150 72.0


line true false branch
246 0 4 if ($args->{'spec'}) { }
0 4 elsif ($args->{'yaml_spec'}) { }
4 0 elsif ($args->{'spec_file'}) { }
270 0 0 if $spec->{'config'} and $spec->{'config'}{'config_terminator'}
274 0 0 if $spec->{'config'} and $spec->{'config'}{'config_separator'}
278 0 0 if $spec->{'config'} and exists $spec->{'config'}{'strict_ascii'}
282 0 0 if $spec->{'config'} and exists $spec->{'config'}{'truncate_null'}
286 0 0 if $spec->{'config'} and exists $spec->{'config'}{'auto_configure'}
316 1 3 if ($self->{'auto_configure'})
326 4 0 unless $self->{'terminator'} =~ /[\r\n]/
385 0 64 unless $definition
391 265 44 if $def->{'name'}
435 4 0 unless exists $record->{'GROUPS'}
441 4 72 if ($type eq 'ISA') { }
4 68 elsif ($type eq 'IEA') { }
4 64 elsif ($type eq 'GS') { }
4 60 elsif ($type eq 'GE') { }
4 56 elsif ($type eq 'ST') { }
4 52 elsif ($type eq 'SE') { }
546 156 0 unless exists $loop_def{$section}
547 0 156 unless $spec->{'structure'}{$section}
549 68 279 if (ref $segment and ref $segment eq 'HASH') { }
567 16 36 if ($section eq 'DETAIL') { }
1 35 elsif ($section eq 'HEADER' and $IN_DETAIL) { }
5 30 elsif ($section eq 'FOOTER') { }
0 60 elsif ($section eq 'DETAIL' and $IN_FOOTER) { }
588 52 0 if (my $type_def = $spec->{'segments'}{uc $type})
592 17 35 if ($section eq 'DETAIL') { }
595 4 13 unless exists $current_record->{$section}
600 10 25 unless exists $current_record->{$section}
604 23 29 if (@LOOP_PARENTS)
610 19 7 if ($LOOP_PARENTS[-1]{'segments'}{$type}) { }
622 4 48 if (not @LOOP_PARENTS and $loop_def{$section}{$type}) { }
3 45 elsif (@LOOP_PARENTS and $LOOP_PARENTS[-1]{'next_loop_segments'}{$type}) { }
628 0 4 unless $loop_def{$section}{$type}
630 2 12 if (ref $ld eq 'HASH') { }
650 2 2 $section eq 'DETAIL' ? :
659 3 0 unless exists $record_part->{$type}
663 0 3 unless $LOOP_PARENTS[-1]{'next_loop_segments'}{$type}
665 0 7 if (ref $ld eq 'HASH') { }
689 29 23 unless @LOOP_PARENTS
692 23 29 if (@LOOP_PARENTS) { }
695 14 9 unless $section
701 4 19 unless exists $$RECORD_PART{$LOOP_PARENT->{'type'}}
704 5 18 if exists $$RECORD_PART{$LOOP_PARENT->{'type'}}[-1]{$type}
714 12 17 if ($section eq 'DETAIL') { }
717 3 9 if exists $current_record->{$section}[-1]{$type}
748 0 76 unless $type_def->{'definition'}
750 0 333 unless ref $record eq 'HASH'
753 289 44 $def->{'name'} && exists $$record{$def->{'name'}} ? :
755 46 287 unless defined $value
761 0 187 if $value ne '' and not $def->{'bytes'} and $def->{'min'} and length $value < $def->{'min'}
764 96 237 if $def->{'bytes'}
770 168 165 if $def->{'max'}
773 277 56 if $value
774 277 56 if $value
777 0 333 if $self->{'strict_ascii'}
783 76 0 if ($self->{'truncate_null'})
787 76 17 if $val ne ''
795 76 0 if $self->{'new_lines'}
810 9 61 if (ref $section and ref $section eq 'HASH') { }
815 2 7 unless $record_part->{$loop_name}
817 0 12 unless $loop_structure
827 9 52 unless exists $record_part->{$section}
854 0 4 unless exists $record->{'ISA'}{'control_number'}
865 0 4 unless $record->{'GROUPS'}
869 0 4 unless exists $group->{'control_number'}
880 0 4 unless $group->{'SETS'}
885 0 4 unless exists $set->{'control_number'}
899 0 4 unless $spec
910 0 4 unless $spec->{'structure'}{'header'}
918 0 4 unless $set->{'DETAIL'}
920 0 7 unless $spec->{'structure'}{'detail'}
929 0 4 unless $spec->{'structure'}{'footer'}
940 0 4 if ($self->{'spec'}{'RECORD_OFFSET_COUNT'})