Branch Coverage

blib/lib/PDL/IO/FlexRaw.pm
Criterion Covered Total %
branch 115 244 47.1


line true false branch
287 0 24 unless open my $hfile, $hname
292 0 24 if $line1 =~ /^ENVI\r?$/
299 52 84 if /^#/ or /^\s*$/
305 0 92 if $token =~ /^#/
306 28 64 if ($mode == -2) { }
28 36 elsif ($mode == -1) { }
36 0 elsif ($mode < $ndims) { }
0 0 elsif ($mode == $ndims and not $have_badvalue) { }
0 0 elsif ($mode == $ndims and $have_badvalue and $numtokens > 0) { }
307 24 4 if ($newfile)
308 0 24 if ($token eq "f77" or $token eq "swap")
316 0 28 unless exists $flextypes{$token}
322 0 28 unless $token =~ /^\d*$/
324 0 28 if $ndims < 0
327 0 28 if $mode == $ndims and $numtokens == 0
329 0 36 unless $token =~ /^\d*$/
334 28 8 if $mode == $ndims and $numtokens == 0
336 0 0 if ($token =~ /^badvalue$/) { }
339 0 0 if $numtokens == 0
349 24 28 if $mode == -2
350 0 28 if $ndims < 0 or $mode != $ndims
352 0 28 $have_badvalue ? :
366 0 27 if $verbose
368 0 27 unless ($nread = read($d, ${$pdl->get_dataref;}, $len)) == $len
383 4 0 ref $dims ? :
386 4 0 unless $^O =~ /MSWin32/i
389 4 0 $flexmapok ? :
418 0 1 if @_ < 2 or @_ > 3 or not UNIVERSAL::isa($pdl, "PDL")
422 0 1 if (defined fileno $name) { }
425 0 1 if ref $name
426 0 1 unless -f $name
428 0 1 unless open $d, ">>", $name
434 0 1 if $pdl->type != "PDL::Type"->new($hash->{'Type'})
435 1 0 ref $hash->{'Dims'} ? :
436 0 1 if @dims < 2
438 0 1 unless all($pdl->shape == pdl(@ldims))
443 0 1 if (defined wantarray) { }
445 0 0 if $isname and $writeflexhdr
449 1 0 if $isname
470 0 23 if @_ > 2
478 0 23 if (defined fileno $name) { }
483 0 23 unless (-e $name)
489 0 0 unless (defined $gzip_version)
493 0 0 unless (defined $gzip_version)
498 0 0 unless defined $gzip_version
500 0 0 if ($gzip_version =~ /^Apple/) { }
512 0 23 unless open $d, $data
518 1 22 if ref $h->[0]{'Dims'} and @{$h->[0]{'Dims'};} and not defined $h->[0]{'Dims'}[-1] and @$h > 1
522 0 22 if ($type eq 'swap') { }
22 0 elsif ($type ne 'f77') { }
531 2 23 if @_ == 2
532 22 3 if ($newfile)
533 0 22 if ($type eq 'f77') { }
0 22 elsif ($type eq 'swap') { }
543 2 23 if (@_ == 2)
544 0 2 unless defined $flextypes{$type}
547 25 0 ref $hdr->{'Dims'} ? :
548 24 1 defined $dims[-1] ? :
550 1 24 if (@dims and not defined $dims[-1]) { }
564 0 25 if ($swapbyte)
566 0 0 if $method
568 0 25 if ($newfile and $f77mode)
569 0 0 if ($zipt or $swapbyte) { }
577 0 0 if $swapbyte
579 0 0 unless seek $d, $pdl->at, 1
580 0 0 if read($d, ${$chunk->get_dataref;}, $len) != $len
582 0 0 if $swapbyte
583 0 0 if $pdl->at != $chunk->at
585 0 0 unless seek $d, 4, 0
591 0 25 if ($hdr->{'BadFlag'})
593 0 0 if defined $hdr->{'BadValue'}
596 0 25 if ($f77mode and $chunk->at == $chunkread)
600 0 0 if $swapbyte
601 0 0 if ($check->at ne $chunk->at)
605 0 0 if eof $d
607 0 0 if $swapbyte
610 6 16 if (wantarray) { }
646 1 1 if (ref $_ eq 'ARRAY') { }
1 0 elsif (ref $_ eq 'HASH') { }
654 0 1 if $name =~ s/\.gz$// or $name =~ s/\.Z$// or not -e $name and -e $name . '.gz' || -e $name . '.Z'
657 3 1 unless defined $h
661 0 4 if $type eq "swap"
662 0 4 if ($type eq 'f77') { }
665 0 4 unless defined $flextypes{$type}
672 0 4 if $f77mode
673 3 1 unless ($opts{'Creat'})
676 0 3 if $size < $s
679 0 4 $opts{'ReadOnly'} ? :
680 1 3 $opts{'Creat'} ? :
681 1 3 $opts{'Creat'} || $opts{'Trunc'} ? :
688 1 3 if @_ == 2
689 4 0 if ($newfile)
690 0 4 if ($type eq 'f77') { }
697 1 3 if (@_ == 2)
698 0 1 unless defined $flextypes{$type}
703 0 4 unless defined $pdl
706 0 4 if ($newfile and $f77mode)
707 0 0 if ($opts{'Creat'}) { }
715 0 4 if ($hdr->{'BadFlag'})
717 0 0 if defined $hdr->{'BadValue'}
720 0 4 if ($f77mode and $chunk->at == $chunkread)
723 0 0 unless defined $check
725 0 0 if ($opts{'Creat'}) { }
728 0 0 if $check->at ne $chunk->at
731 0 0 if $offset < $size
735 0 4 if (wantarray) { }
741 8 0 ref $dims ? :
771 0 20 unless @_
777 0 20 if (defined fileno $name) { }
780 0 20 if ref $name
782 0 20 $name =~ /^[+]?[><|]/ ? :
783 0 20 unless open $fh, $modename
787 0 22 unless ref $pdl
789 22 0 $pdl->badvalue == $pdl->orig_badvalue ? :
797 19 1 if (defined wantarray) { }
799 0 19 if $isname and $writeflexhdr
803 1 0 if $isname
830 0 21 if @_ != 2 or not ref $_[1]
833 0 21 unless open my $h, ">", $hname
839 0 24 unless exists $flextypes{$type}
841 24 0 ref $_->{'Dims'} ? :
0 24 $_->{'BadFlag'} ? :