Branch Coverage

blib/lib/Async/Redis.pm
Criterion Covered Total %
branch 9 270 3.3


line true false branch
51 0 68 unless eval { do { require Protocol::Redis::XS; 1 } }
56 0 0 $INC{'Protocol/Redis/XS.pm'} ? :
66 0 0 if $delay > $self->{'reconnect_delay_max'}
69 0 0 if ($self->{'reconnect_jitter'} > 0)
82 0 70 if ($args{'uri'})
85 0 0 if ($uri)
167 0 70 if ($self->{'debug'} or $self->{'otel_tracer'} or $self->{'otel_meter'})
187 0 70 if $self->{'connected'}
197 0 70 unless my $socket = "IO::Socket::INET"->new("Proto", "tcp", "Blocking", 0)
205 0 70 unless my $addr = inet_aton($self->{'host'})
227 70 0 if ($completed_f->is_failed)
232 0 70 if ($error eq "connect_timeout")
246 0 0 if ($self->{'tls'})
250 0 0 if ($@)
269 0 0 if ($self->{'auto_pipeline'})
277 0 0 if ($self->{'on_connect'})
283 0 0 if ($self->{'_telemetry'})
300 0 0 if ($self->{'password'})
302 0 0 if $self->{'username'}
312 0 0 unless ($result and $result eq "OK")
321 0 0 if ($self->{'database'} and $self->{'database'} != 0)
328 0 0 unless ($result and $result eq "OK")
337 0 0 if ($self->{'client_name'})
349 0 0 $self->{'connected'} ? :
361 0 0 if ($self->{'_current_read_future'} and not $self->{'_current_read_future'}->is_ready)
367 0 0 if (my $inflight = $self->{'inflight'})
369 0 0 if ($entry->{'future'} and not $entry->{'future'}->is_ready)
376 0 0 if ($self->{'socket'})
383 0 0 if ($was_connected and $self->{'on_disconnect'})
388 0 0 if ($was_connected and $self->{'_telemetry'})
400 0 70 if ($self->{'socket'} and fileno $self->{'socket'})
410 0 0 unless my $socket = delete $self->{'socket'}
416 0 0 if (my $inflight = delete $self->{'inflight'})
418 0 0 if ($entry->{'future'} and not $entry->{'future'}->is_ready)
426 0 0 if defined $fileno
438 0 0 if ($self->{'_pid'} and $self->{'_pid'} != $$)
452 0 0 if ($self->{'_telemetry'})
470 0 0 if utf8::is_utf8($bytes)
506 0 0 if ($entry->{'future'} and not $entry->{'future'}->is_ready)
518 0 0 if $self->{'_reading_responses'}
535 0 0 unless ($read_ok)
554 0 0 if (not $decode_ok) { }
557 0 0 unless $entry->{'future'}->is_ready
560 0 0 unless $entry->{'future'}->is_ready
573 0 0 if (my $msg = $self->{'parser'}->get_message)
582 0 0 if (not defined $buf or length $buf == 0)
588 0 0 if (my $msg = $self->{'parser'}->get_message)
601 0 0 if ($cmd =~ /^(BLPOP|BRPOP|BLMOVE|BRPOPLPUSH|BLMPOP|BZPOPMIN|BZPOPMAX|BZMPOP)$/u)
607 0 0 if ($cmd =~ /^(XREAD|XREADGROUP)$/u)
610 0 0 if (uc $args[$i] eq "BLOCK")
632 0 0 if (ref $self->{'tls'} eq 'HASH') { }
633 0 0 if $self->{'tls'}{'ca_file'}
634 0 0 if $self->{'tls'}{'cert_file'}
635 0 0 if $self->{'tls'}{'key_file'}
637 0 0 if (exists $self->{'tls'}{'verify'}) { }
639 0 0 $self->{'tls'}{'verify'} ? :
654 0 0 unless "IO::Socket::SSL"->start_SSL($socket, %ssl_opts)
661 0 0 if (&Time::HiRes::time() >= $deadline)
671 0 0 if ($rv)
678 0 0 if $remaining <= 0
680 0 0 if ($IO::Socket::SSL::SSL_ERROR == IO::Socket::SSL::SSL_ERROR_WANT_READ()) { }
0 0 elsif ($IO::Socket::SSL::SSL_ERROR == IO::Socket::SSL::SSL_ERROR_WANT_WRITE()) { }
690 0 0 if ($wait_f->is_failed)
707 0 0 if ($wait_f->is_failed)
737 0 0 if ($@)
741 0 0 if ($self->{'on_error'})
759 0 0 if ($self->{'in_pubsub'})
761 0 0 unless ($ucmd =~ /^(SUBSCRIBE|UNSUBSCRIBE|PSUBSCRIBE|PUNSUBSCRIBE|SSUBSCRIBE|SUNSUBSCRIBE|PING|QUIT)$/u)
769 0 0 if (defined $self->{'prefix'} and $self->{'prefix'} ne "")
776 0 0 if ($self->{'_auto_pipeline'})
781 0 0 if (not $self->{'connected'} and $self->{'reconnect'})
787 0 0 unless $self->{'connected'}
792 0 0 if ($self->{'_telemetry'})
816 0 0 if (not $send_ok) { }
820 0 0 unless $response_future->is_ready
831 0 0 unless ($await_ok)
837 0 0 if ($self->{'_telemetry'})
839 0 0 if ($error) { }
848 0 0 if $error
857 0 0 if (my $msg = $self->{'parser'}->get_message)
865 0 0 if ($remaining <= 0)
892 0 0 if ($read_f->is_cancelled)
898 0 0 if ($wait_f->is_failed)
900 0 0 if ($error eq "read_timeout")
919 0 0 if (not defined $buf or length $buf == 0)
928 0 0 if (my $msg = $self->{'parser'}->get_message)
943 0 0 if ($self->{'_current_read_future'} and not $self->{'_current_read_future'}->is_ready)
949 0 0 if (my $inflight = $self->{'inflight'})
951 0 0 if ($entry->{'future'} and not $entry->{'future'}->is_ready)
958 0 0 if ($self->{'socket'})
966 0 0 if ($was_connected and $self->{'on_disconnect'})
975 0 0 unless $msg
981 0 0 if ($type eq '+') { }
0 0 elsif ($type eq '-') { }
0 0 elsif ($type eq ':') { }
0 0 elsif ($type eq '$') { }
0 0 elsif ($type eq '*') { }
998 0 0 unless defined $data
1017 0 0 if exists $opts{'ex'}
1018 0 0 if exists $opts{'px'}
1019 0 0 if $opts{'nx'}
1020 0 0 if $opts{'xx'}
1086 0 0 if $mode
1104 0 0 if ($@)
1108 0 0 if ("$error" =~ /NOSCRIPT/iu) { }
1134 0 0 unless defined $name and length $name
1135 0 0 unless ref $def eq "HASH"
1136 0 0 unless defined $def->{'lua'}
1139 0 0 unless $name =~ /^[a-zA-Z_][a-zA-Z0-9_]*$/u
1153 0 0 if ($def->{'install'})
1166 0 0 unless my $script = $self->{'_scripts'}{$name}
1172 0 0 if ($num_keys eq "dynamic")
1174 0 0 unless defined $num_keys
1201 0 0 unless @names
1284 0 0 if $self->{'in_multi'}
1301 0 0 if ($collect_error)
1307 0 0 unless (@commands)
1339 0 0 if ($error)
1358 0 0 if $self->{'in_multi'}
1359 0 0 if $self->{'watching'}
1360 0 0 if $self->{'in_pubsub'}
1361 0 0 if @{$self->{'inflight'} // [];} > 0
1422 0 0 unless (@commands)
1445 0 0 if ($error)
1463 0 0 unless @{$self->{'inflight'};}
1471 0 0 if (@{$self->{'inflight'};})
1492 0 0 unless $self->{'connected'}
1521 0 0 unless $self->{'connected'}
1546 0 0 unless $self->{'connected'}
1608 0 0 unless $self->{'connected'}
1610 0 0 unless @$commands
1640 0 0 if ($@)
1643 0 0 if defined $result
1655 0 0 unless ($ok)
1660 0 0 if ($self->{'_telemetry'})