Branch Coverage

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


line true false branch
83 1245 0 if @_
124 1050 5535 if (@_)
148 1020 934 if (@_)
153 5 1015 if (UNIVERSAL::isa($value, 'Astro::FITS::Header')) { }
0 1049 elsif (defined $self->type and $self->type eq 'HEADER') { }
178 1024 631 if (@_)
209 1069 3428 if (@_)
211 1060 9 if defined $type
254 1108 713 if (@_)
256 985 123 if (defined $card)
259 188 797 if ($clen < 80) { }
0 797 elsif ($clen > 80) { }
273 152 1669 unless defined $self->{'Card'}
331 1192 53 if (exists $hash{'Card'}) { }
332 207 985 if (ref $hash{'Card'} and $hash{'Card'}->isa('Astro::FITS::Header::Item')) { }
345 164 48 if exists $hash{$key}
349 20 33 unless ($self->type)
350 0 20 if (not $self->keyword || $self->value) { }
2 18 elsif (not $self->keyword or $self->keyword =~ /^(COMMENT|HISTORY)$/) { }
358 18 0 if defined $type
363 2 51 if $self->keyword eq 'END'
418 0 985 unless @_
433 328 657 if ($keyword eq 'HIERARCH' or $card =~ /^\s+HIERARCH/)
439 0 985 if $card =~ /^\s+HIERARCH/
447 6 979 if ($keyword eq 'END')
457 0 979 if (length $card == 0)
465 12 949 if ($keyword eq 'COMMENT' or $keyword eq 'HISTORY' or substr($card, 8, 2) ne '= ' and not $keyword =~ /^HIERARCH/)
472 0 30 if (length $card <= 8) { }
493 249 700 if (substr($rest, 0, 1) eq q[']) { }
498 1 248 if (substr($rest, 1, 1) eq q[']) { }
509 0 249 if $pos == -1
513 1 248 if (substr($rest, $pos + 1, 1) eq q['])
526 248 0 if ($end != -1) { }
535 2 246 if ($value =~ /^\s+$/) { }
561 3 697 if ($pos == 0) { }
693 4 elsif ($pos != -1) { }
574 693 0 if (length $rest > $pos + 1) { }
587 697 3 if (defined $value)
593 18 679 if ($value eq 'T') { }
15 664 elsif ($value eq 'F') { }
334 330 elsif ($value =~ /\.|e/) { }
612 945 4 if (defined $comment)
613 0 945 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 152 if (defined $type and $type eq 'HEADER')
755 3 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 15 3 if (not defined $value) { }
3 0 elsif ($value =~ /^\d+$/) { }
0 0 elsif ($value =~ /^(-?)(\d*)(\.?)(\d*)([EeDd][-\+]?\d+)?$/) { }