Condition Coverage

blib/lib/Atomic/Pipe.pm
Criterion Covered Total %
condition 158 277 57.0


and 2 conditions

line l !l condition
134 11 16 $_[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.
326 119 71 $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.

and 3 conditions

line !l l&&!r l&&r condition
37 0 0 67 "POSIX"->can("PIPE_BUF") and eval { do { &POSIX::PIPE_BUF() } }
44 0 0 67 "POSIX"->can("SSIZE_MAX") and eval { do { &POSIX::SSIZE_MAX() } }
59 0 0 67 $can_thread &&= $] >= "5.008001"
60 0 67 0 $can_thread &&= $Atomic::Pipe::Config{'useithreads'}
63 67 0 0 $can_thread and $] == "5.01"
67 0 0 $can_thread and $] == "5.01" and $Atomic::Pipe::Config{'ccname'} eq "gcc"
0 0 0 $can_thread and $] == "5.01" and $Atomic::Pipe::Config{'ccname'} eq "gcc" and $Atomic::Pipe::Config{'gccversion'}
65 0 0 0 $parts[0] == 4 and $parts[1] >= 8
68 67 0 0 $can_thread &&= !$INC{'Devel/Cover.pm'}
209 170269 0 5430565 $self->{'in_buffer_size'} and $self->{'in_buffer_size'} >= $size
212 4 0 0 $params{'eof_invalid'} and $self->{'eof'}
294 90 10 0 defined $buffer->{'lines'} and length $buffer->{'lines'}
295 90 10 0 defined $buffer->{'lines'} and length $buffer->{'burst'}
335 180 6 2 defined $params{'compression_dictionary'} and defined $params{'compression_dictionary_file'}
339 176 6 4 defined $params{'compression_dictionary'} || defined $params{'compression_dictionary_file'} and not defined $params{'compression'}
542 310 54 0 $self->eof and keys %{$$self{'state'}{'buffers'};} || keys %{$$self{'state'}{'parts'};}
550 110 0 24 $self->{'eof'} and not $self->{'in_buffer_size'}
110 0 24 $self->{'eof'} and not $self->{'in_buffer_size'} and defined $line
0 0 24 $self->{'eof'} and not $self->{'in_buffer_size'} and defined $line and length $line
553 106 0 4 $params{'peek_line'} and defined $line
106 0 4 $params{'peek_line'} and defined $line and length $line
560 0 0 0 $self->{'eof'} and not $self->{'in_buffer_size'}
621 92 0 4 $peek and not $self->{'eof'}
741 21 0 15 $self->{'rh'} and not $self->{'wh'}
0 0 21 $self->{'wh'} and not $self->{'rh'}
751 0 0 0 $r and $w
799 0 0 8 $self->{'rh'} and not $self->{'wh'}
805 0 0 8 $self->{'wh'} and not $self->{'rh'}
1028 19 2 2 $self->{'keep_compressed'} and wantarray

or 2 conditions

line l !l condition
128 0 0 $self->{'read_size'} ||= 65536
158 170518 121 $self->{'in_buffer_size'} //= 0
160 0 170639 $self->{'read_size'} || 65536
166 271 146135 $self->{'read_blocking'} // 1
240 0 10 $self->{'compression_level'} // 3
265 2 33 $self->{'compression_level'} // 3
305 8 0 fcntl($fh, 3, 0) // (return undef)
444 0 104 $self->{'burst_prefix'} //= "\16"
445 0 104 $self->{'burst_postfix'} //= "\17"
446 0 104 $self->{'message_key'} //= "\20"
529 144 44 $self->{'mixed_buffer'} //= {"lines", "", "burst", "", "in_burst", 0, "in_message", 0, "do_extra_loop", 0, "strip_term", 0}
579 38 0 $self->_get_from_buffer(1, "eof_invalid", "EOF before message terminator") // (return)
586 66 0 $self->_peek_from_buffer(1, "eof_invalid", "Incomplete burst data received before end of pipe") // (next)
595 26 0 $buffer->{'burst'} //= ""
651 0 0 $buffer->{$key} // ""
671 0 0 'Win32::API'->new('kernel32', 'PeekNamedPipe', 'NPIPPP', 'N') || die(q[Can't load PeekNamedPipe from kernel32.dll])
691 0 0 'Win32::API'->new('kernel32', 'SetNamedPipeHandleState', 'NPPP', 'N') || die(q[Can't load SetNamedPipeHandleState from kernel32.dll])
857 12 88 $_[0]{'burst_prefix'} // ""
12 88 $_[0]{'burst_postfix'} // ""
882 2 10 $self->{'out_buffer'} //= []
904 399 200091 ($params{'blocking'} // $self->{'write_blocking'}) // 1
906 200491 0 $self->{'out_buffer'} // (return)
929 20 800587 $self->{'burst_prefix'} // ""
930 20 800587 $self->{'burst_postfix'} // ""
938 2 800605 $! == 32 or 0
943 375 800230 $! == 11 or 0
946 0 0 $wrote //= ""
958 8 82 $self->{'message_key'} // ""
959 8 82 $self->{'burst_prefix'} // ""
960 8 82 $self->{'burst_postfix'} // ""
973 8 200112 $self->{'message_key'} // ""
990 32 41 $self->{'out_buffer'} //= []
1000 800104 45 $self->{'out_buffer'} //= []
1036 700116 97 $self->{'state'} //= {}
1049 2800343 0 $self->_get_from_buffer($key->{'size'}, "eof_invalid", "EOF before end of message") // (return)
1053 2100154 700189 $state->{'parts'}{$tag} //= []

or 3 conditions

line l !l&&r !l&&!r condition
65 0 0 0 $parts[0] > 4 or $parts[0] == 4 and $parts[1] >= 8
121 14 20 0 $self->{'invalid_state'} //= @_ ? shift() : "Unknown Error"
165 146314 92 0 $self->{'_select'} //= "IO::Select"->new($rh)
232 14 8 70 defined $_[0]{'compression_dictionary'} || defined $_[0]{'compression_dictionary_file'}
261 2 8 0 $self->{'_compression_ctx'} //= "Compress::Zstd::CompressionContext"->new
262 0 10 0 $self->{'_compression_cdict'} //= $self->_build_cdict
273 4 8 0 $self->{'_decompression_ctx'} //= "Compress::Zstd::DecompressionContext"->new
274 2 10 0 $self->{'_decompression_ddict'} //= $self->_build_ddict
294 48 0 100 $buffer->{'lines'} or defined $buffer->{'lines'} and length $buffer->{'lines'}
295 0 0 100 $buffer->{'burst'} or defined $buffer->{'lines'} and length $buffer->{'burst'}
339 6 4 176 defined $params{'compression_dictionary'} || defined $params{'compression_dictionary_file'}
375 4 0 0 $class->_fh_mode($ifh) // croak("Could not determine filehandle mode, please specify '>&' or '<&'")
6 4 0 $mode //= $class->_fh_mode($ifh) // croak("Could not determine filehandle mode, please specify '>&' or '<&'")
376 10 0 0 $class->_mode_to_dir($mode) // croak("Invalid mode: $mode")
388 8 0 0 $class->_mode_to_dir($mode) // croak("Invalid mode: $mode")
523 188 0 0 $self->{'rh'} // croak("Not a read handle")
525 188 0 0 $self->{'burst_prefix'} // croak("missing 'burst_prefix', not in mixed_data_mode")
526 188 0 0 $self->{'burst_postfix'} // croak("missing 'burst_postfix', not in mixed_data_mode")
527 188 0 0 $self->{'message_key'} // croak("missing 'message_key', not in mixed_data_mode")
542 6 0 48 keys %{$$self{'state'}{'buffers'};} || keys %{$$self{'state'}{'parts'};}
544 186 0 172 $buffer->{'lines'} or length $buffer->{'lines'}
620 106 0 96 $self->{'in_buffer_size'} or $self->fill_buffer
671 0 0 0 $peek_named_pipe //= 'Win32::API'->new('kernel32', 'PeekNamedPipe', 'NPIPPP', 'N') || die(q[Can't load PeekNamedPipe from kernel32.dll])
691 0 0 0 $set_named_pipe_handle_state //= 'Win32::API'->new('kernel32', 'SetNamedPipeHandleState', 'NPPP', 'N') || die(q[Can't load SetNamedPipeHandleState from kernel32.dll])
752 0 0 0 $r or $w
759 0 2 0 $self->{'wh'} // $self->{'rh'}
768 9 1 0 $self->{'wh'} // $self->{'rh'}
787 3 0 0 $val + 0 || $ONE_MB
857 0 12 88 $_[0]{'delimiter_size'} //= &bytes::length(scalar($_[0]{'burst_prefix'} // "")) + &bytes::length(scalar($_[0]{'burst_postfix'} // ""))
866 8 0 4 $self->{'delimiter_size'} // $self->delimiter_size
879 4 8 2 $self->{'delimiter_size'} // $self->delimiter_size
904 1 399 200091 $params{'blocking'} // $self->{'write_blocking'}
912 800182 51 374 $blocking or defined $got
932 20 0 800587 length $prefix or length $postfix
944 0 0 800230 not $wrote or $RETRY_ERRNO{0 + $!}
974 200030 90 0 $self->{'adjusted_dsize'} // $self->_adjusted_dsize
988 32 0 41 $self->{'delimiter_size'} // $self->delimiter_size
999 800104 4 41 $self->{'delimiter_size'} // $self->delimiter_size