Branch Coverage

blib/lib/Data/Embed/Writer.pm
Criterion Covered Total %
branch 73 114 64.0


line true false branch
21 24 38 if (not defined $output && length $output or $output eq '-')
23 0 24 unless open my $fh, '>&', \*STDOUT
25 0 24 unless binmode $fh
34 9 29 unless ($oref)
40 3 6 if ($self->{'input_type'} eq 'file' and $output eq $self->{'input'})
41 0 3 unless open my $fh, '+<', $output
43 0 3 unless binmode $fh
50 0 6 unless open my $fh, '>', $output
52 0 6 unless binmode $fh
58 22 7 if ($oref eq 'SCALAR')
64 7 15 if ($self->{'input_type'} eq 'scalar-ref' and &refaddr($output) eq &refaddr($self->{'input'}))
67 0 7 unless open my $fh, '+<', $output
69 0 7 unless binmode $fh
76 0 15 unless open my $fh, '>', $output
78 0 15 unless binmode $fh
99 24 38 unless (defined $input)
108 7 31 if ($input eq '-')
110 0 7 unless open my $fh, '<&', \*STDIN
112 0 7 unless binmode $fh
121 10 21 unless ($iref)
123 0 10 unless open my $fh, '<', $input
125 0 10 unless binmode $fh
133 14 7 if ($iref eq 'SCALAR')
135 0 14 unless open my $fh, '<', $input
137 0 14 unless binmode $fh
154 62 0 unless ($self->{'input_transferred'})
157 38 24 if ($self->{'input_fh'})
158 10 28 if ($self->{'output_same_as_input'}) { }
177 28 0 if (not @index) { }
0 0 elsif (not $index_completed) { }
178 0 28 if ($_ eq $starter) { }
187 0 0 if (/\A \s* (\d+) \s+ (\S*) \s*\z/msx) { }
0 0 elsif ($_ eq $terminator) { }
219 0 62 scalar @_ && ref $_[0] ? :
220 62 0 unless exists $args{'transfer_input'}
231 62 0 if $args{'transfer_input'}
238 0 106 scalar @_ && ref $_[0] ? :
241 7 99 defined $args{'inputs'} ? :
250 4 108 if (defined $args->{'input'})
251 1 3 if ($args->{'input'} eq '-') { }
252 0 1 unless open my $fh, '<&', \*STDIN
254 0 1 unless binmode $fh
260 2 1 if (not $ref or $ref eq 'SCALAR') { }
269 8 104 if (defined $args->{'fh'}) { }
4 100 elsif (defined $args->{'filename'}) { }
100 0 elsif (defined $args->{'data'}) { }
285 0 111 unless defined $name
286 107 4 ref $filename eq 'SCALAR' ? :
292 0 111 unless open my $fh, '<', $filename
294 0 111 unless binmode $fh
312 0 121 unless defined(my $nread = read($input_fh, $buffer, 4096))
314 0 121 unless $nread
315 0 121 unless print {$output_fh;} $buffer
322 0 121 unless print {$output_fh;} "\n\n"
325 0 121 unless defined $name
334 0 62 unless print {$output_fh;} "Data::Embed/index/begin\n", @$index, "Data::Embed/index/end\n"
342 3 59 if exists $self->{'output_fh'}