Branch Coverage

blib/lib/File/Text/CSV.pm
Criterion Covered Total %
branch 36 90 40.0


line true false branch
114 10 0 unless exists $opts->{'binary'}
118 0 10 unless $self
121 0 10 if ($file eq '-') { }
122 0 0 if $append
126 0 10 $append ? :
127 0 10 unless CORE::open $self->{'_fh'}, $mode, $file
134 5 5 if ($header)
135 0 2 unless $header->[0]
2 3 if (eval { do { 1 unless $header->[0] } }) { }
0 3 elsif ($encoding) { }
145 0 0 unless $res
146 0 0 if @$res == 1 and $res->[0] eq ""
154 2 1 if ($line)
155 0 2 if ($line =~ /^\x{ff}\x{fe}\0\0(.*)/s) { }
0 2 elsif ($line =~ /^\0\0\x{fe}\x{ff}(.*)/s) { }
0 2 elsif ($line =~ /^\x{ef}\x{bb}\x{ff}(.*)/s) { }
0 2 elsif ($line =~ /^\x{ff}\x{fe}(.*)/s) { }
0 2 elsif ($line =~ /^\x{fe}\x{ff}(.*)/s) { }
184 3 0 if ($encoding ||= "UTF-8")
188 1 2 unless $res
190 0 2 if @res == 1 and $res[0] eq ""
199 0 9 if $ENV{'File_CSV_ENC_DEBUG'}
200 9 0 unless $encset
240 0 0 unless exists $opts->{'binary'}
244 0 0 unless $self
247 0 0 if ($file eq '-') { }
252 0 0 unless defined $opts->{'encoding'}
253 0 0 if $opts->{'encoding'}
254 0 0 unless CORE::open $self->{'_fh'}, $mode, $file
259 0 0 if ($header)
261 0 0 unless $status
275 4 28 unless (defined $self->{'_columns'})
281 2 26 unless $n == $self->{'_columns'}
298 16 10 unless $self->{'_column_names'}
300 2 8 if $self->eof
301 0 8 unless $res
318 7 24 if $self->eof
319 0 24 unless $res
339 0 0 if (not ref $row[0]) { }
0 0 elsif (eval { do { 1 unless $row[0][0] } }) { }
342 0 0 unless $row[0][0]
354 0 0 if %row
357 0 0 if $self->{'_append'}
360 0 0 unless $status
373 0 0 unless $self->{'_fh'}->close