Branch Coverage

blib/lib/Astro/FITS/Header/Item.pm
Criterion Covered Total %
branch 113 152 74.3


line true false branch
83 1353 0 if @_
124 1158 5651 if (@_)
148 1114 938 if (@_)
153 5 1109 if (UNIVERSAL::isa($value, 'Astro::FITS::Header')) { }
0 1146 elsif (defined $self->type and $self->type eq 'HEADER') { }
178 1130 633 if (@_)
209 1179 3617 if (@_)
211 1170 9 if defined $type
254 1214 793 if (@_)
256 1091 123 if (defined $card)
259 249 842 if ($clen < 80) { }
0 842 elsif ($clen > 80) { }
273 154 1853 unless defined $self->{'Card'}
331 1298 55 if (exists $hash{'Card'}) { }
332 207 1091 if (ref $hash{'Card'} and $hash{'Card'}->isa('Astro::FITS::Header::Item')) { }
345 166 54 if exists $hash{$key}
349 22 33 unless ($self->type)
350 0 22 if (not $self->keyword || $self->value) { }
2 20 elsif (not $self->keyword or $self->keyword =~ /^(COMMENT|HISTORY)$/) { }
358 20 0 if defined $type
363 4 51 if $self->keyword eq "END"
418 0 1091 unless @_
433 328 763 if ($keyword eq "HIERARCH" or $card =~ /^\s+HIERARCH/)
439 0 1091 if $card =~ /^\s+HIERARCH/
447 9 1082 if ($keyword eq "END")
457 0 1082 if (length $card == 0)
465 12 1040 if ($keyword eq "COMMENT" or $keyword eq "HISTORY" or substr($card, 8, 2) ne "= " and not $keyword =~ /^HIERARCH/)
472 0 42 if (length $card <= 8) { }
493 276 764 if (substr($rest, 0, 1) eq q[']) { }
498 1 275 if (substr($rest, 1, 1) eq q[']) { }
509 0 276 if $pos == -1
513 1 275 if (substr($rest, $pos + 1, 1) eq "'")
526 275 0 if ($end != -1) { }
535 5 270 if ($value =~ /^\s+$/) { }
561 3 761 if ($pos == 0) { }
757 4 elsif ($pos != -1) { }
574 757 0 if (length $rest > $pos + 1) { }
587 761 3 if (defined $value)
593 24 737 if ($value eq 'T') { }
17 720 elsif ($value eq 'F') { }
372 348 elsif ($value =~ /\.|e/) { }
612 1036 4 if (defined $comment)
613 0 1036 if ($comment =~ /^\s+$/) { }
653 661 2 if (defined $val1 and defined $val2) { }
2 0 elsif (not defined $val1 || defined $val2) { }
655 0 661 if ($val1 ne $val2)
672 0 221 if defined $val1 and not defined $val2 or defined $val2 and not defined $val1
674 26 0 unless defined $val1 or defined $val2
676 174 21 if ($type eq 'FLOAT' or $type eq 'INT') { }
14 7 elsif ($type eq 'STRING') { }
7 0 elsif ($type eq 'LOGICAL') { }
0 0 elsif ($type eq 'COMMENT') { }
0 0 elsif ($type eq 'HEADER') { }
0 0 elsif ($type eq 'UNDEF') { }
681 7 0 if ($val1 and $val2 or not $val1 || $val2) { }
696 0 0 if @items1 != @items2
699 0 0 unless $items1[$i]->equals($items2[$i])
746 0 154 if (defined $type and $type eq "HEADER")
755 5 149 if (defined $type and $type eq 'END') { }
0 149 elsif (defined $type and $type eq 'BLANK') { }
10 139 elsif (defined $type and $type eq 'COMMENT') { }
0 139 elsif (not defined $type || defined $value || defined $comment) { }
763 10 0 defined $comment ? :
778 0 139 unless (defined $type)
784 106 33 if ($type eq 'INT' or $type eq 'FLOAT' or $type eq 'LOGICAL' or $type eq 'UNDEF') { }
33 0 elsif ($type eq 'STRING') { }
788 7 99 if ($type eq "LOGICAL")
789 5 2 $value && $value ne 'F' ? :
793 2 104 unless defined $value
812 33 0 if (defined $value) { }
822 20 13 if (length $value < 8)
823 18 2 unless length $value == 0
839 138 1 if (defined $comment and length $comment > 0) { }
873 17 3 if (not defined $value) { }
3 0 elsif ($value =~ /^\d+$/) { }
0 0 elsif ($value =~ /^(-?)(\d*)(\.?)(\d*)([EeDd][-\+]?\d+)?$/) { }