Branch Coverage

lib/PDL/IO/Misc.pd
Criterion Covered Total %
branch 149 290 51.3


line true false branch
97 30 0 if (ref $_[0] ne "ARRAY")
114 0 32 if (ref $data eq 'ARRAY') { }
127 0 59 if (ref $data eq 'ARRAY') { }
4 55 elsif (ref $databox->[0] eq 'ARRAY') { }
147 0 12 unless ref $deftype eq "PDL::Type"
150 12 0 ref $types eq 'ARRAY' ? :
152 2 10 if ($#cols > -1)
154 0 2 if $#cols > $ncols
158 0 2 unless ref $cols[$_] eq "PDL::Type"
340 0 12 if $#_ < 0
344 2 10 $is_handle ? :
345 10 2 unless $is_handle
364 10 2 if (defined $_[0])
366 1 9 if ($_[0] =~ m[^/.*/$]) { }
0 9 elsif (ref $_[0] eq 'Regexp') { }
2 7 elsif (ref $_[0] eq 'HASH') { }
372 4 8 if defined $_[-1] and ref $_[-1] eq "HASH"
378 0 12 defined $PDL::IO::Misc::colsep ? :
379 1 11 if $options->{'COLSEP'}
383 12 12 if ($options->{$pattern} and ref $options->{$pattern} ne "Regexp")
384 12 0 if ($options->{$pattern} =~ m[^/.*/$]) { }
401 0 12 if $options->{'PERLCOLS'}
413 1 11 if ($options->{'LINES'} ne "")
414 1 0 if ($options->{'LINES'} =~ /^\s*([+-]?\d*)\s*:\s*([+-]?\d*)\s*$/) { }
0 0 elsif ($options->{'LINES'} =~ /^\s*([+-]?\d*)\s*:\s*([+-]?\d*)\s*:\s*([+]?\d*)\s*$/) { }
425 1 11 if defined $x and $x ne ""
426 1 11 if defined $y and $y ne ""
433 11 1 if ($index_start >= 0 and $index_end < 0) { }
1 0 elsif ($index_end >= 0 and $index_start < 0) { }
0 0 elsif ($index_end >= $index_start and $index_start >= 0) { }
0 0 elsif ($index_start > $index_end and $index_end >= 0) { }
0 0 elsif ($index_start <= $index_end) { }
467 0 12 if ($options->{'COLIDS'})
468 0 0 if $options->{'VERBOSE'}
470 0 0 if (defined($fhline = readline $fh)) { }
472 0 0 defined $usecolsep ? :
475 0 0 if $!
494 0 55 if defined $line_end and $line_num > $line_end
495 0 55 if defined $line_start and $line_num < $line_start
496 8 47 if $options->{'EXCLUDE'} and $fhline =~ /$options->{'EXCLUDE'}/
497 6 41 if $options->{'INCLUDE'} and not $fhline =~ /$options->{'INCLUDE'}/
498 0 41 unless ++$line_ctr == $line_step
502 5 36 defined $usecolsep ? :
505 1 89 if ($_ eq '') { }
509 11 30 if ($index == 0)
512 3 8 if ($#explicit_cols < 0)
515 2 9 if (scalar @explicit_cols == 1 and ref $explicit_cols[0] eq "ARRAY")
516 1 1 unless (scalar @{$explicit_cols[0];})
523 2 18 if (ref $col eq 'ARRAY') { }
524 0 2 unless scalar @$col
529 0 11 if ($implicit_pdls > 1)
533 0 20 if (ref $col eq "ARRAY" and not scalar @$col)
543 2 18 if (ref $col eq 'ARRAY') { }
18 0 elsif (not $is_perl_col[$col]) { }
553 0 20 if (ref $col ne "ARRAY" and defined $is_perl_col[$col])
560 0 11 if ($options->{'VERBOSE'})
572 2 18 if (ref $_ eq 'ARRAY') { }
576 0 18 $is_perl_col[$_] ? :
577 18 0 unless $is_perl_col[$_]
587 10 31 if ($pdlsize < $index)
595 9 64 if (ref $_ eq 'ARRAY') { }
606 11 30 if ($index >= $nextburpindex)
612 0 41 if defined $line_end and $line_num == $line_end
617 10 2 unless $is_handle
622 28 3 if defined $_ and scalar @{$_->[1];}
627 1 11 if ($index == -1)
628 0 1 if $options->{'VERBOSE'}
629 0 1 if (wantarray) { }
631 0 0 if ($is_perl_col[$_]) { }
647 10 0 if ($line_rev == 0 and $index_start >= 0 and $index_end >= -1)
650 18 0 unless ref $_ eq "ARRAY"
652 0 10 if ($options->{'VERBOSE'})
653 0 0 if (ref $ret[0] eq 'ARRAY') { }
659 8 2 wantarray ? :
667 1 0 if ($line_rev)
668 0 1 if (defined $line_start and defined $line_end) { }
1 0 elsif (defined $line_start) { }
678 1 0 if $index_start < 0
679 0 1 if $index_end < 0
684 1 0 if ($line_rev) { }
693 0 2 if (ref $col eq 'ARRAY') { }
698 2 0 unless $is_perl_col[$col]
704 0 2 if ($is_perl_col[$_])
712 0 1 if ($options->{'VERBOSE'})
715 0 0 if $done
716 0 0 if $is_perl_col[$col]
721 0 0 if $done
729 0 2 if ref $col eq "ARRAY"
730 0 2 if $col->ndims == 2
733 1 0 wantarray ? :
810 0 4 if @_ < 1
813 0 4 defined $PDL::IO::Misc::colsep ? :
818 2 2 if (ref $_[-1] eq "HASH")
821 0 2 if ($key =~ /^H/i) { }
0 2 elsif ($key =~ /^COLSEP/i) { }
2 0 elsif ($key =~ /^FORMAT/i) { }
829 3 1 if (ref \$_[0] eq "SCALAR" or $format_string)
830 2 1 if ref \$_[0] eq "SCALAR"
841 4 0 if ($is_handle) { }
845 0 0 if (ref \$file eq 'SCALAR') { }
847 0 0 unless ($is_handle)
848 0 0 unless $file =~ /^\|/ or $file =~ /^\>/
849 0 0 unless open $fh, $file
861 0 4 ref $p[0] eq 'ARRAY' ? :
864 0 8 if (ref $_ eq 'ARRAY') { }
865 0 0 if scalar @{$_;} != $n
868 0 8 if $_->dim(0) != $n or $_->getndims > 2
869 0 8 if ($_->getndims == 2) { }
876 0 4 if (defined $header)
877 0 0 unless $header =~ /\n$/
883 12 4 if ($format_string) { }
888 12 12 if (@d == $step)
890 0 12 unless $pdone == $pcnt
894 0 12 if (@d and not $i)
896 0 0 if ($#dogp > 0) { }
911 4 4 $pdone == $pcnt ? :
916 0 4 if $file_opened
948 0 0 if (ref \$_[0] eq "SCALAR")
955 0 0 ref $p[0] eq 'ARRAY' ? :
957 0 0 if (ref $_ eq 'ARRAY') { }
958 0 0 if scalar @{$_;} != $n
960 0 0 if $_->nelem != $n or $_->getndims != 1
966 0 0 if ($format_string) { }
970 0 0 if (@d == $step)
975 0 0 if (@d and not $i)
977 0 0 if ($#p > 0) { }
994 0 0 wantarray ? :
1041 0 1 if $#_ > 2
1048 1 0 $is_handle ? :
1049 0 1 unless $is_handle
1051 0 1 if (ref $pattern ne "CODE")
1072 0 1 unless ref $options->{'DEFTYPE'} eq "PDL::Type"
1075 0 5 unless @v = &$pattern
1078 1 4 if ($m == 0) { }
1088 0 4 if $nret != $#v
1090 1 4 if ($n < $m)
1100 0 10 if ($v[$_] eq '') { }
1102 0 0 if ($undef_is_bad) { }
1115 0 1 unless $is_handle
1117 1 0 wantarray ? :
1174 0 0 unless ref $reader eq "CODE"
1181 0 0 if $PDL::verbose
1184 0 0 if ($k == 0) { }
1185 0 0 if $PDL::verbose
1189 0 0 if $im->getdim(0) != $nx or $im->getdim(1) != $ny