Branch Coverage

blib/lib/Mojo/SMTP/Client.pm
Criterion Covered Total %
branch 74 96 77.0


line true false branch
70 2 80 unless (substr($resp->code, 0, 1) == $this->{'expected_code'})
83 4 13 @_ % 2 == 0 ? :
86 13 4 $cb ? :
89 1 0 if ($self->{'stream'} and $self->{'server'} ne $self->_server || $self->{'stream'}->is_readable && !$self->{'starttls'} && !$self->{'authorized'} && grep({$self->{'last_cmd'} == $_;} 1, 7, 8))
96 1 16 if ($self->{'stream'}) { }
125 0 15 unless eval { do { *{$_[0];} } }
134 14 2 if (not @_ or $_[0] ne 'hello')
148 11 6 if @_ == 2
150 17 0 if ($cb)
152 5 12 unless ($r->isa('Mojo::SMTP::Client::Response'))
168 4 13 unless ($self->{'nb'})
173 3 1 $self->autodie && $resp->error ? :
179 0 1 unless exists $self->{'delay'}
186 37 12 $self->{'nb'} ? :
199 0 2 if $self->{'cleanup_cb'}
223 11 61 unless ($cmd)
225 4 7 if ($self->{'stream'})
232 61 0 if (my $sub = $self->can("_cmd_$cmd"))
260 3 10 if (my $e = $@)
261 2 1 unless $e->isa('Mojo::SMTP::Client::Response')
270 10 1 if delete $resp->{'checked'}
281 2 0 if require IO::Socket::SSL
302 0 0 @_ >= 2 ? :
308 0 2 $self->tls_ca ? :
0 2 unless $sock = 'IO::Socket::SSL'->start_SSL($self->{'stream'}->steal_handle, 'SSL_ca_file', $self->tls_ca, 'SSL_cert_file', $self->tls_cert, 'SSL_key_file', $self->tls_key, 'SSL_verify_mode', $self->tls_verify, 'SSL_verifycn_name', $self->address, 'SSL_verifycn_scheme', $self->tls_ca ? 'smtp' : undef, 'SSL_startHandshake', 0, 'SSL_error_trap', $error_handler)
325 2 4 if ($sock->connect_SSL)
336 4 0 if $IO::Socket::SSL::SSL_ERROR == 60200464
338 0 0 if $IO::Socket::SSL::SSL_ERROR == 60200536
345 0 2 unless ($resp)
368 1 1 if ($type eq 'plain')
381 1 0 if ($type eq 'login')
437 3 10 ref $arg ? :
465 2 5 if (ref $arg eq 'CODE') { }
472 2 42 unless ($data_writer_cb)
480 23 21 if ref $data
482 2 42 unless (length $data > 0)
483 2 0 $was_nl ? :
491 2 40 unless defined $last_ch
492 2 40 if ($last_ch eq "\r") { }
7 33 elsif ($last_ch eq "\n") { }
496 2 0 if $data =~ s/^\012(\.?)/$1$1/u
500 4 3 if $data =~ /^\./u
514 0 5 ref $arg ? :
515 0 5 ref $arg ? :
519 0 5 _has_nl($arg) ? :
578 84 2 if ($resp =~ /^\d+(?:\s[^\n]*)?\n$/mu)
595 0 47 ref $_[0] ? :
600 5 10 if ($self->{'stream'})