Branch Coverage

blib/lib/Text/xSV.pm
Criterion Covered Total %
branch 81 134 60.4


line true false branch
8 0 1 unless my $field_pos = $$self{'field_pos'}
11 0 1 unless (exists $$field_pos{$from})
19 0 2 unless my $field_pos = $$self{'field_pos'}
22 0 2 unless (UNIVERSAL::isa($compute, 'CODE'))
48 0 1 unless my $field_pos = $$self{'field_pos'}
52 1 0 if (exists $$field_pos{$field}) { }
71 0 25 unless my $row = $$self{'row'}
73 0 25 unless my $lookup = $$self{'field_pos'}
78 43 2 if (exists $$lookup{$field}) { }
80 35 8 if (not ref $position_or_compute) { }
1 7 elsif (exists $$cached_results{$field}) { }
2 5 elsif ($$in_compute{$field}) { }
105 19 2 wantarray ? :
110 1 3 @_ ? :
113 3 1 wantarray ? :
118 1 1 unless $self->get_row
126 0 0 unless my $field_pos = $$self{'field_pos'}
131 0 0 if (defined $pos) { }
139 0 0 unless my $header = $$self{'header'}
146 0 0 if ($$self{'header'}) { }
161 4 0 if ($$self{'row_size_warning'})
162 1 3 if (not exists $$self{'row_size'}) { }
0 3 elsif (@_ != $$self{'row_size'}) { }
177 3 13 if (not defined $value) { }
3 10 elsif ('' eq $value) { }
3 7 elsif ($value =~ /\s|\Q$sep\E|"/) { }
179 1 2 $$self{'quote_all'} ? :
183 1 2 $$self{'dont_quote'} ? :
192 1 2 $$self{'dont_quote'} ? :
196 1 6 $$self{'quote_all'} ? :
205 0 4 unless my $field_pos = $$self{'field_pos'}
223 2 0 $$self{'filename'} ? :
229 0 15 unless $fh
230 2 13 unless defined($line = <$fh>)
231 13 0 if ($$self{'filter'})
236 0 13 if ($is_error)
239 2 11 if (not exists $$self{'row_size'}) { }
0 11 elsif (not $$self{'row_size_warning'}) { }
0 11 elsif ($$self{'row_size'} != @row) { }
252 1 12 wantarray ? :
264 16 25 if ($1 eq '"') { }
269 21 4 length $1 ? :
272 13 28 unless ($line =~ /$match_sep/g)
273 13 0 if ($pos == length $line) { }
0 0 elsif ($$self{'strict'}) { }
292 0 0 unless ($line =~ /$match_sep/g)
293 0 0 if ($pos == length $line) { }
315 14 18 if ($line =~ /\G([^"]+)/cg) { }
1 17 elsif ($line =~ /\G""/cg) { }
16 1 elsif ($line =~ /\G"/g) { }
328 0 1 unless (defined($line = <$fh>))
334 1 0 if ($$self{'filter'})
363 0 3 if ($$self{'dont_quote'} and $$self{'quote_all'})
389 0 27 unless (exists $allowed{$arg})
408 3 0 if (not $file =~ /\||<|>/ and @_)
413 0 3 unless (open $fh, $file)
424 1 0 $$self{'filename'} ? :
430 0 4 unless $fh
431 0 4 unless print $fh @_
453 0 0 if (1 == @_ and UNIVERSAL::isa($_[0], 'ARRAY')) { }
459 0 0 if (not exists $$self{'field_pos'})
472 4 1 if (1 == length $sep) { }
482 0 0 if ($$self{'warning_handler'}) { }
487 0 0 if $@
493 2 0 if ($$self{'close_fh'})
494 0 0 $! ? :
0 2 unless close $$self{'fh'}