Branch Coverage

blib/lib/Redis/Fast.pm
Criterion Covered Total %
branch 21 124 16.9


line true false branch
22 0 0 if $host =~ /:/ or $host =~ /%/
27 0 4 if ($hostport =~ /\A\[([^\]]+)\]:([0-9]+)\z/)
39 68 0 unless ($self->is_subscriber)
43 0 0 if ref $n eq "CODE"
44 0 0 if defined $n
45 0 68 if defined $name
48 0 68 if defined $data->{'current_database'}
55 0 0 if ($topic =~ /(p?message):(.*)$/)
58 0 0 if ($key eq 'message') { }
66 0 68 if defined $on_conn
72 0 68 if (defined $password)
80 0 0 if (defined $err)
81 0 0 if ($err =~ /ERR invalid password|WRONGPASS invalid username-password pair/) { }
109 0 70 if ($reconnect_on_error) { }
114 0 0 if ($next_reconnect_interval < -1)
125 0 0 if (-1 < $next_reconnect_interval)
141 0 0 if ($ENV{'REDIS_SERVER'} and not $args{'sock'} and not $args{'server'})
142 0 0 if ($ENV{'REDIS_SERVER'} =~ m[^/]) { }
0 0 elsif ($ENV{'REDIS_SERVER'} =~ /^unix:(.+)/) { }
0 0 elsif ($ENV{'REDIS_SERVER'} =~ /^(tcp:)?(.+)/) { }
165 66 4 if ($args{'sock'}) { }
0 4 elsif ($args{'sentinels'}) { }
169 0 0 unless ref $sentinels eq "ARRAY"
172 0 0 unless defined($self->__get_data->{'service'} = $args{'service'})
173 0 0 if exists $args{'ssl'} and $args{'ssl'}
183 0 0 unless my $sentinel = eval { do { "Redis::Fast::Sentinel"->new("server", $sentinel_address, "password", $data->{'sentinels_password'}, "cnx_timeout", exists $data->{'sentinels_cnx_timeout'} ? $data->{'sentinels_cnx_timeout'} : "0.1", "read_timeout", exists $data->{'sentinels_read_timeout'} ? $data->{'sentinels_read_timeout'} : 1, "write_timeout", exists $data->{'sentinels_write_timeout'} ? $data->{'sentinels_write_timeout'} : 1) } }
192 0 0 exists $data->{'sentinels_cnx_timeout'} ? :
0 0 exists $data->{'sentinels_read_timeout'} ? :
0 0 exists $data->{'sentinels_write_timeout'} ? :
196 0 0 unless defined $server_address
199 0 0 if $server_address eq "IDONTKNOW"
207 0 0 unless ($data->{'no_sentinels_list_update'})
239 0 70 $args{'debug'} || $ENV{'REDIS_DEBUG'} ? :
244 0 2 if ($args{'ssl'} and 1 and $args{'SSL_verify_mode'})
246 0 0 if $args{'SSL_verify_mode'} == 0
247 0 0 if $args{'SSL_verify_mode'} == 1
248 0 0 if $args{'SSL_verify_mode'} == 2
249 0 0 if $args{'SSL_verify_mode'} == 4
252 0 70 if (my $cb = $self->_new_reconnect_on_error_cb($args{'reconnect_on_error'}))
256 69 1 unless $args{'no_auto_connect_on_new'}
275 14 54 if defined $error
276 9 45 wantarray && ref $ret eq 'ARRAY' ? :
299 0 0 if defined $error
300 0 0 unless ref $ret eq "ARRAY"
307 0 0 unless $self->__sock
310 0 0 if defined $error
321 3 0 if defined $error
322 0 0 unless ref $ret eq "ARRAY"
343 0 0 if defined $error
356 0 0 unless ref $cb eq "CODE"
366 0 0 if $unsub
369 0 0 if (@subs)
387 0 0 if $cb
392 0 0 if ($cbs) { }
394 0 0 unless (%$cbs)
418 0 0 unless $subs->{$key} and @{$subs->{$key};}
420 0 0 if @$cbs
433 0 0 if ($m->[0] =~ /^p?message$/)
442 0 0 unless $unsub
452 0 0 defined $m->[2] ? :
454 0 0 unless (exists $subs->{$cbid})
468 0 71 if $self->is_subscriber