Branch Coverage

blib/lib/Async/Redis.pm
Criterion Covered Total %
branch 22 280 7.8


line true false branch
52 0 73 unless eval { do { require Protocol::Redis::XS; 1 } }
57 0 0 $INC{'Protocol/Redis/XS.pm'} ? :
67 0 0 if $delay > $self->{'reconnect_delay_max'}
70 0 0 if ($self->{'reconnect_jitter'} > 0)
83 2 79 if ($args{'uri'})
86 2 0 if ($uri)
165 4 77 $args{'path'} ? :
4 77 $args{'path'} ? :
169 0 81 if ($self->{'debug'} or $self->{'otel_tracer'} or $self->{'otel_meter'})
189 0 75 if $self->{'connected'}
194 1 74 if ($self->{'path'}) { }
199 0 1 unless socket $socket, 1, 1, 0
211 0 74 unless $socket = "IO::Socket::INET"->new("Proto", "tcp", "Blocking", 0)
219 0 74 unless my $addr = inet_aton($self->{'host'})
242 75 0 if ($completed_f->is_failed)
247 0 75 if ($error eq "connect_timeout")
261 0 0 if ($self->{'tls'})
265 0 0 if ($@)
284 0 0 if ($self->{'auto_pipeline'})
292 0 0 if ($self->{'on_connect'})
298 0 0 if ($self->{'_telemetry'})
316 0 0 if ($self->{'password'})
318 0 0 if $self->{'username'}
328 0 0 unless ($result and $result eq "OK")
337 0 0 if ($self->{'database'} and $self->{'database'} != 0)
344 0 0 unless ($result and $result eq "OK")
353 0 0 if ($self->{'client_name'})
365 0 0 $self->{'connected'} ? :
377 0 0 if ($self->{'_current_read_future'} and not $self->{'_current_read_future'}->is_ready)
383 0 0 if (my $inflight = $self->{'inflight'})
385 0 0 if ($entry->{'future'} and not $entry->{'future'}->is_ready)
392 0 0 if ($self->{'socket'})
399 0 0 if ($was_connected and $self->{'on_disconnect'})
404 0 0 if ($was_connected and $self->{'_telemetry'})
416 0 81 if ($self->{'socket'} and fileno $self->{'socket'})
426 0 0 unless my $socket = delete $self->{'socket'}
432 0 0 if (my $inflight = delete $self->{'inflight'})
434 0 0 if ($entry->{'future'} and not $entry->{'future'}->is_ready)
442 0 0 if defined $fileno
454 0 0 if ($self->{'_pid'} and $self->{'_pid'} != $$)
468 0 0 if ($self->{'_telemetry'})
486 0 0 if utf8::is_utf8($bytes)
522 0 0 if ($entry->{'future'} and not $entry->{'future'}->is_ready)
534 0 0 if $self->{'_reading_responses'}
551 0 0 unless ($read_ok)
570 0 0 if (not $decode_ok) { }
573 0 0 unless $entry->{'future'}->is_ready
576 0 0 unless $entry->{'future'}->is_ready
589 0 0 if (my $msg = $self->{'parser'}->get_message)
598 0 0 if (not defined $buf or length $buf == 0)
604 0 0 if (my $msg = $self->{'parser'}->get_message)
617 0 0 if ($cmd =~ /^(BLPOP|BRPOP|BLMOVE|BRPOPLPUSH|BLMPOP|BZPOPMIN|BZPOPMAX|BZMPOP)$/u)
623 0 0 if ($cmd =~ /^(XREAD|XREADGROUP)$/u)
626 0 0 if (uc $args[$i] eq "BLOCK")
648 0 0 if (ref $self->{'tls'} eq 'HASH') { }
649 0 0 if $self->{'tls'}{'ca_file'}
650 0 0 if $self->{'tls'}{'cert_file'}
651 0 0 if $self->{'tls'}{'key_file'}
653 0 0 if (exists $self->{'tls'}{'verify'}) { }
655 0 0 $self->{'tls'}{'verify'} ? :
670 0 0 unless "IO::Socket::SSL"->start_SSL($socket, %ssl_opts)
677 0 0 if (&Time::HiRes::time() >= $deadline)
687 0 0 if ($rv)
694 0 0 if $remaining <= 0
696 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()) { }
706 0 0 if ($wait_f->is_failed)
723 0 0 if ($wait_f->is_failed)
753 0 0 if ($@)
757 0 0 if ($self->{'on_error'})
772 0 0 unless my $sub = $self->{'_subscription'}
811 0 0 if ($self->{'in_pubsub'})
813 0 0 unless ($ucmd =~ /^(SUBSCRIBE|UNSUBSCRIBE|PSUBSCRIBE|PUNSUBSCRIBE|SSUBSCRIBE|SUNSUBSCRIBE|PING|QUIT)$/u)
821 0 0 if (defined $self->{'prefix'} and $self->{'prefix'} ne "")
828 0 0 if ($self->{'_auto_pipeline'})
833 0 0 if (not $self->{'connected'} and $self->{'reconnect'})
839 0 0 unless $self->{'connected'}
844 0 0 if ($self->{'_telemetry'})
868 0 0 if (not $send_ok) { }
872 0 0 unless $response_future->is_ready
883 0 0 unless ($await_ok)
889 0 0 if ($self->{'_telemetry'})
891 0 0 if ($error) { }
900 0 0 if $error
909 0 0 if (my $msg = $self->{'parser'}->get_message)
917 0 0 if ($remaining <= 0)
944 0 0 if ($read_f->is_cancelled)
950 0 0 if ($wait_f->is_failed)
952 0 0 if ($error eq "read_timeout")
971 0 0 if (not defined $buf or length $buf == 0)
980 0 0 if (my $msg = $self->{'parser'}->get_message)
995 0 1 if ($self->{'_current_read_future'} and not $self->{'_current_read_future'}->is_ready)
1001 1 0 if (my $inflight = $self->{'inflight'})
1003 0 0 if ($entry->{'future'} and not $entry->{'future'}->is_ready)
1010 0 1 if ($self->{'socket'})
1019 0 1 if ($was_connected and $self->{'on_disconnect'})
1028 0 0 unless $msg
1034 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 '*') { }
1051 0 0 unless defined $data
1070 0 0 if exists $opts{'ex'}
1071 0 0 if exists $opts{'px'}
1072 0 0 if $opts{'nx'}
1073 0 0 if $opts{'xx'}
1139 0 0 if $mode
1157 0 0 if ($@)
1161 0 0 if ("$error" =~ /NOSCRIPT/iu) { }
1187 0 0 unless defined $name and length $name
1188 0 0 unless ref $def eq "HASH"
1189 0 0 unless defined $def->{'lua'}
1192 0 0 unless $name =~ /^[a-zA-Z_][a-zA-Z0-9_]*$/u
1206 0 0 if ($def->{'install'})
1219 0 0 unless my $script = $self->{'_scripts'}{$name}
1225 0 0 if ($num_keys eq "dynamic")
1227 0 0 unless defined $num_keys
1254 0 0 unless @names
1337 0 0 if $self->{'in_multi'}
1354 0 0 if ($collect_error)
1360 0 0 unless (@commands)
1392 0 0 if ($error)
1411 0 0 if $self->{'in_multi'}
1412 0 0 if $self->{'watching'}
1413 0 0 if $self->{'in_pubsub'}
1414 0 0 if @{$self->{'inflight'} // [];} > 0
1475 0 0 unless (@commands)
1498 0 0 if ($error)
1516 0 0 unless @{$self->{'inflight'};}
1524 0 0 if (@{$self->{'inflight'};})
1545 0 0 unless $self->{'connected'}
1574 0 0 unless $self->{'connected'}
1599 0 0 unless $self->{'connected'}
1624 0 0 unless $self->{'connected'}
1665 0 0 unless $self->{'connected'}
1667 0 0 unless @$commands
1697 0 0 if ($@)
1711 0 0 unless ($ok)
1716 0 0 if ($self->{'_telemetry'})