Branch Coverage

blib/lib/Atomic/Pipe.pm
Criterion Covered Total %
branch 234 330 70.9


line true false branch
13 67 0 if (eval { do { require IO::Select; 1 } }) { }
30 67 0 if "Errno"->can("ERESTART")
37 67 0 if ('POSIX'->can('PIPE_BUF') and eval { do { &POSIX::PIPE_BUF() } }) { }
44 67 0 if ('POSIX'->can('SSIZE_MAX') and eval { do { &POSIX::SSIZE_MAX() } }) { }
63 0 0 if ($can_thread and $] == "5.01" and $Atomic::Pipe::Config{'ccname'} eq "gcc" and $Atomic::Pipe::Config{'gccversion'})
65 0 0 if $parts[0] > 4 or $parts[0] == 4 and $parts[1] >= 8
70 67 0 if (not $can_thread) { }
0 0 elsif ($INC{'threads.pm'}) { }
77 0 0 $INC{'threads.pm'} ? :
80 0 67 if ($^O eq 'MSWin32') { }
82 0 0 unless eval { do { require Win32::API; 1 } }
83 0 0 unless eval { do { require Win32API::File; 1 } }
121 20 0 @_ ? :
127 0 0 if @_
133 27 170639 if (@_)
134 0 27 if $_[0] and Deparse error: Can't locate object method "object_2svref" via package "B::SPECIAL" at /usr/local/lib/perl5/5.42.0/B/Deparse.pm line 5762.
135 16 11 $_[0] ? :
136 11 16 unless $_[0]
140 146377 24244 $val ? :
170621 45 defined $val ? :
147 4 6 $_[0]{'keep_compressed'} ? :
152 0 170857 if $self->{'invalid_state'}
154 0 170857 unless my $rh = $self->{'rh'}
156 218 170639 if $self->{'eof'}
164 146406 24233 if ($use_select) { }
167 146154 252 $blocking ? :
168 171 146235 unless @ready
174 0 170468 unless $to_read
179 93 170375 unless (defined $got)
180 93 0 if $! == 11
181 0 0 if ($RETRY_ERRNO{0 + $!})
182 0 0 unless $use_select
188 170331 44 if ($got) { }
209 170269 5430565 unless ($self->{'in_buffer_size'} and $self->{'in_buffer_size'} >= $size)
211 4 170265 unless ($self->{'in_buffer_size'} >= $size)
212 4 0 unless $params{'eof_invalid'} and $self->{'eof'}
219 5600764 66 if ($params{'remove'}) { }
242 4 6 if (defined(my $path = $self->{'compression_dictionary_file'}))
251 4 6 if (defined(my $path = $self->{'compression_dictionary_file'}))
259 10 35 if ($self->_has_dict)
271 12 35 if ($self->_has_dict) { }
280 6 41 unless defined $out
287 14 492 if $self->{'invalid_state'}
289 66 426 if $self->fill_buffer
290 218 208 unless $self->{'eof'}
291 60 148 if $self->{'in_buffer_size'}
293 148 0 if (my $buffer = $self->{'mixed_buffer'})
294 48 100 if $buffer->{'lines'} or defined $buffer->{'lines'} and length $buffer->{'lines'}
295 0 100 if $buffer->{'burst'} or defined $buffer->{'lines'} and length $buffer->{'burst'}
306 4 4 if $mode == 0
307 4 0 if $mode == 1
326 0 190 if $params{'use_io_select'} and Deparse error: Can't locate object method "object_2svref" via package "B::SPECIAL" at /usr/local/lib/perl5/5.42.0/B/Deparse.pm line 5762.
328 34 156 if (defined(my $algo = $params{'compression'}))
329 2 32 unless $algo eq "zstd"
331 0 32 unless eval { do { require Compress::Zstd; 1 } }
335 2 186 if defined $params{'compression_dictionary'} and defined $params{'compression_dictionary_file'}
339 4 182 if defined $params{'compression_dictionary'} || defined $params{'compression_dictionary_file'} and not defined $params{'compression'}
347 0 22 unless -p $fifo
349 0 22 unless open my $fh, "+<", $fifo
360 0 13 unless -p $fifo
362 0 13 unless open my $fh, ">", $fifo
373 0 10 unless -p $ifh
378 0 10 unless open my $fh, $mode, $ifh
389 0 8 unless open my $fh, $mode, $fd
391 0 8 unless -p $fh
404 0 2 unless pipe $rh, $wh
421 0 145 unless pipe $rh, $wh
429 52 93 if ($mixed)
440 0 104 if $self->{'invalid_state'}
442 52 52 if $self->{'rh'}
453 6 10 unless (defined $algo)
463 2 8 unless $algo eq "zstd"
465 0 8 unless eval { do { require Compress::Zstd; 1 } }
470 2 6 if defined $level
483 4 0 if (defined $bytes) { }
485 0 4 unless defined $self->{'compression'}
499 4 4 if (defined $path) { }
501 0 4 unless defined $self->{'compression'}
515 2 2 $val ? :
542 6 48 if $self->eof and keys %{$$self{'state'}{'buffers'};} || keys %{$$self{'state'}{'parts'};}
544 186 172 if ($buffer->{'lines'} or length $buffer->{'lines'})
549 52 134 if $term
550 24 0 if $self->{'eof'} and not $self->{'in_buffer_size'} and defined $line and length $line
553 4 0 if $params{'peek_line'} and defined $line and length $line
556 40 242 if ($buffer->{'in_message'})
559 0 40 unless (defined $id)
560 0 0 unless $self->{'eof'} and not $self->{'in_buffer_size'}
566 14 26 if (defined $message)
567 4 10 if ($self->{'compression'})
571 2 2 if $self->{'keep_compressed'}
578 38 230 if ($buffer->{'strip_term'})
581 0 38 unless $term eq $postfix
585 66 202 if ($buffer->{'in_burst'})
588 40 26 if ($peek eq $key)
600 18 8 if ($term) { }
605 6 12 if ($self->{'compression'})
608 2 4 if $self->{'keep_compressed'}
617 8 0 if $self->{'eof'}
620 96 106 unless ($self->{'in_buffer_size'} or $self->fill_buffer)
621 4 92 if $peek and not $self->{'eof'}
623 38 54 unless $self->{'eof'}
626 24 30 if $buffer->{'eof'}++
635 106 0 if defined $linedata
637 66 40 if ($buffer->{'in_burst'}) { }
680 0 0 if $ret == 0
695 0 0 $state ? :
704 0 67 unless my $rh = $self->{'rh'}
706 67 0 if @_
717 0 21 unless my $wh = $self->{'wh'}
719 0 21 unless @_
729 0 21 unless defined $flags
730 5 16 if ($val) { }
732 0 21 unless fcntl $wh, &Fcntl::F_SETFL, $flags
741 15 21 if ($self->{'rh'} and not $self->{'wh'}) { }
21 0 elsif ($self->{'wh'} and not $self->{'rh'}) { }
751 0 0 if $r and $w
752 0 0 unless $r or $w
758 0 2 unless defined &Fcntl::F_GETPIPE_SZ
767 0 10 unless defined &Fcntl::F_SETPIPE_SZ
778 0 3 unless -e "/proc/sys/fs/pipe-max-size"
780 0 3 unless open my $max, "<", "/proc/sys/fs/pipe-max-size"
799 8 0 if $self->{'rh'} and not $self->{'wh'}
805 8 0 if $self->{'wh'} and not $self->{'rh'}
812 0 6 unless open my $fh, ">&:raw", $self->{'wh'}
819 0 0 unless open my $fh, "<&:raw", $self->{'rh'}
826 0 0 unless $self->{'wh'}
828 0 0 unless $self->{'rh'}
837 0 2 unless $self->{'rh'}
839 0 2 unless $self->{'wh'}
847 38 2 if $self->{'wh'}
848 2 38 if $self->{'rh'}
856 0 100 if defined $_[0]{'delimiter_size'}
864 4 8 if $self->{'compression'}
867 2 10 unless $size <= 4096
876 6 8 if $self->{'compression'}
880 2 12 unless $size <= 4096
890 2 345 if $self->{'hit_epipe'}
891 1 344 if $self->pending_output
896 260 89 unless my $buffer = $self->{'out_buffer'}
897 86 3 unless @$buffer
912 374 800233 unless $blocking or defined $got
913 3 800230 unless defined $got
925 0 800609 unless my $wh = $self->{'wh'}
927 2 800607 if $self->{'hit_epipe'}
932 20 800587 if length $prefix or length $postfix
938 2 800605 if ($! == 32 or 0)
943 375 800230 if $! == 11 or 0
944 0 800230 if not $wrote or $RETRY_ERRNO{0 + $!}
945 800230 0 if $wrote == $size
956 0 90 if defined $self->{'adjusted_dsize'}
970 31 200089 if $self->{'compression'}
978 200120 0 if $dtotal % $adjusted_dsize
983 73 200047 if ($parts == 1) { }
988 4 69 $message_key ? :
1014 4 700169 unless defined $id
1016 700140 29 unless $self->{'compression'}
1018 4 25 if ($params{'debug'})
1021 2 2 if $self->{'keep_compressed'}
1028 2 21 if $self->{'keep_compressed'} and wantarray
1039 2800347 0 unless ($state->{'key'})
1040 4 2800343 unless my $key_bytes = $self->_get_from_buffer($psize)
1054 2100154 700189 $state->{'buffers'}{$tag} ? :
1058 2100160 700183 unless ($id == 0)
1059 26 2100134 if $params{'one_part_only'}
1066 700170 13 unless $params{'debug'}