Branch Coverage

blib/lib/Mango.pm
Criterion Covered Total %
branch 0 94 0.0


line true false branch
35 0 0 unless (shift())->{'queue'}
49 0 0 unless $str
51 0 0 unless $url->protocol eq 'mongodb'
57 0 0 $2 ? :
58 0 0 if @hosts
61 0 0 if (my $db = $url->path->parts->[0])
64 0 0 if (($url->userinfo // '') =~ /^([^:]+):([^:]+)$/)
72 0 0 if (my $j = $query->param('journal'))
73 0 0 if (my $w = $query->param('w'))
74 0 0 if (my $timeout = $query->param('wtimeoutMS'))
89 0 0 unless $mode
107 0 0 unless $self->_loop(0)
114 0 0 if $loop
127 0 0 unless my $c = delete $self->{'connections'}{$id}
129 0 0 if $last
130 0 0 if @{$self->{'queue'};}
144 0 0 if ($err)
145 0 0 unless @$hosts
152 0 0 if $self
153 0 0 if $self
170 0 0 unless my $c = delete $self->{'connections'}{$id}
174 0 0 if $last
186 0 0 unless $err
188 0 0 unless my $last = shift @{$$self{'queue'};}
207 0 0 $_[1] ? :
214 0 0 unless ($doc->{'maxWireVersion'} || 0) >= 3
217 0 0 if ($doc->{'ismaster'})
218 0 0 $self->_auth ? :
224 0 0 if ($doc->{'primary'} // '') =~ /^(.+):(\d+)$/
225 0 0 unless @$hosts
235 0 0 if $op
241 0 0 unless $op
244 0 0 unless $op->{'nb'} or grep {not $connections->{$_}{'nb'};} @ids
248 0 0 if not $start and @{$self->{'queue'};} and @ids < $self->max_connections
253 0 0 ref $_[-1] eq 'CODE' ? :
266 0 0 unless $reply->{'to'} == $c->{'last'}{'id'}
276 0 0 unless ($self->{'pid'} //= $$) eq $$
279 0 0 if $op->{'cb'}
286 0 0 $err ? :
294 0 0 if $c->{'last'}
296 0 0 unless my $stream = $loop->stream($id)
297 0 0 if (not $loop->is_running and $stream->is_readable)
303 0 0 unless my $last = delete $c->{'fast'}
307 0 0 unless $last or ($c->{'nb'} xor not +($self->{'queue'}[-1] || {})->{'nb'})
308 0 0 $c->{'nb'} ? :
310 0 0 unless $c->{'last'} = $last
315 0 0 if $last->{'safe'}