Branch Coverage

blib/lib/Redis/ClusterRider.pm
Criterion Covered Total %
branch 82 108 75.9


line true false branch
78 1 9 unless (defined $params{'startup_nodes'})
81 1 8 unless (ref $params{'startup_nodes'} eq 'ARRAY')
84 1 7 unless (@{$params{'startup_nodes'};})
100 33 2 unless defined $params{$name}
112 3 2 unless ($self->{'lazy'})
131 0 4 unless (defined $self->{'_slots'})
136 2 2 if (defined $key)
144 4 0 wantarray ? :
150 11 3 if (@_)
153 8 3 if (defined $seconds) { }
154 4 4 if (not &looks_like_number($seconds) or $seconds < 0)
170 0 9 unless (utf8::downgrade($data, 1))
188 1 7 if ($key =~ /\{([^}]*?)\}/)
189 1 0 if (length $1 > 0)
202 3 1 if ($self->{'refresh_interval'} > 0)
214 0 4 if (defined $self->{'_slots'}) { }
221 12 0 unless (defined $nodes_pool{$hostport})
233 0 4 unless (@{$slots;})
239 4 0 unless (defined $self->{'_commands'})
267 28 12 unless (defined $nodes_pool{$hostport})
268 12 16 if (defined $nodes_pool_old->{$hostport}) { }
274 16 0 unless ($is_master)
279 12 16 if ($is_master)
298 1 3 if ($self->{'allow_slaves'} and @slave_nodes)
314 0 4 if ($@)
333 0 20 if exists $commands{$kwd}
337 8 24 if ($flag eq 'readonly')
376 0 0 if (defined $self->{'on_node_connect'})
387 1 7 if (not defined $self->{'_slots'} or $self->{'refresh_interval'} > 0 and Time::HiRes::tv_interval($self->{'_refresh_timestamp'}) > $self->{'refresh_interval'})
399 6 2 if (defined $cmd_info)
400 5 1 if ($cmd_info->{'key_pos'} > 0) { }
0 2 elsif ($cmd_info->{'movablekeys'} and $args->[1] > 0) { }
414 5 3 if (defined $key)
421 0 8 unless (defined $nodes)
441 4 20 $cmd_name eq 'cluster_state' ? :
458 4 21 if ($cmd_name eq 'cluster_state') { }
1 20 elsif ($wantarray) { }
463 4 0 if ($reply->{'cluster_state'} eq 'ok') { }
478 2 23 if ($@)
483 2 23 if ($err_msg)
485 2 0 if ($err_msg =~ /^(?:\[\w+\]\s+)?([A-Z]{3,})/)
489 0 2 if ($err_code eq 'MOVED' or $err_code eq 'ASK')
490 0 0 if ($err_code eq 'MOVED')
497 0 0 unless (defined $nodes_pool->{$fwd_hostport})
504 0 2 if (defined $self->{'on_node_error'})
508 1 1 if (++$fails_cnt < $nodes_num)
509 0 1 if (++$node_index == $nodes_num)
519 1 22 $wantarray ? :
528 7 9 if (defined $slot)
530 0 7 $slot < $_->[0] ? :
7 7 $slot > $_->[1] ? :
534 0 7 unless defined $range
536 4 3 $allow_slaves ? :
543 5 4 $allow_slaves ? :