Branch Coverage

blib/lib/Test/Reporter/Transport/Net/SMTP.pm
Criterion Covered Total %
branch 31 80 38.7


line true false branch
2 2 0 if (not $] < 5.006)
18 4 0 ref $self ? :
31 0 4 $diff < 0 ? :
41 4 0 unless defined $time
57 0 0 unless defined $eol
64 0 0 if $] < 5.005
66 0 0 if ($] >= 5.006)
68 0 0 if (&bytes::length($res) > length $res or $] >= 5.008 and $res =~ /[^\0-\xFF]/)
103 0 0 unless length $eol
110 0 0 unless length $eol
128 4 0 if ($] >= 5.007003) { }
165 4 0 if (defined $smtp)
171 0 4 unless $mx and $smtp
174 0 4 if (@$recipients)
175 0 0 if ($mx =~ /(?:^|\.)(?:perl|cpan)\.org$/)
177 0 0 if ($recipient =~ /(?:@|\.)(?:perl|cpan)\.org$/) { }
184 0 0 if (@bad)
196 0 4 if $via
204 4 0 if $needs_qp
210 2 0 if ref $smtp eq 'Net::SMTP'
212 2 2 unless eval { do { &$die() unless $smtp->mail($envelope_sender); &$die() unless $smtp->to($report->address); if (@$recipients) { &$die() unless $smtp->cc(@$recipients); } ; &$die() unless $smtp->data; &$die() unless $smtp->datasend('Date: ', $self->_format_date, "\n"); &$die() unless $smtp->datasend('Subject: ', $report->subject, "\n"); &$die() unless $smtp->datasend("From: $from\n"); &$die() unless $smtp->datasend('To: ', $report->address, "\n"); if (@$recipients) { &$die() unless $smtp->datasend("Cc: $cc_str\n"); } ; &$die() unless $smtp->datasend('Message-ID: ', $report->message_id, "\n"); &$die() unless $smtp->datasend("X-Reported-Via: Test::Reporter $Test::Reporter::VERSION$via\n"); &$die() unless $smtp->datasend("X-Test-Reporter-Perl: $perl_version\n"); if ($needs_qp) { $smtp->datasend("MIME-Version: 1.0\n"); $smtp->datasend("Content-Type: text/plain; charset=utf-8\n"); $smtp->datasend("Content-Transfer-Encoding: quoted-printable\n"); } ; &$die() unless $smtp->datasend("\n"); foreach my $b (@body) { &$die() unless $smtp->datasend("$b\n"); } ; &$die() unless $smtp->dataend; &$die() unless $smtp->quit; 1 } }
213 0 4 unless $smtp->mail($envelope_sender)
214 0 4 unless $smtp->to($report->address)
215 0 0 unless $smtp->cc(@$recipients)
0 4 if (@$recipients)
216 0 4 unless $smtp->data
217 0 4 unless $smtp->datasend('Date: ', $self->_format_date, "\n")
218 0 4 unless $smtp->datasend('Subject: ', $report->subject, "\n")
219 0 4 unless $smtp->datasend("From: $from\n")
220 0 4 unless $smtp->datasend('To: ', $report->address, "\n")
221 0 0 unless $smtp->datasend("Cc: $cc_str\n")
0 4 if (@$recipients)
222 0 4 unless $smtp->datasend('Message-ID: ', $report->message_id, "\n")
223 0 4 unless $smtp->datasend("X-Reported-Via: Test::Reporter $Test::Reporter::VERSION$via\n")
224 0 4 unless $smtp->datasend("X-Test-Reporter-Perl: $perl_version\n")
225 4 0 if ($needs_qp)
230 0 4 unless $smtp->datasend("\n")
232 0 284 unless $smtp->datasend("$b\n")
234 0 4 unless $smtp->dataend
235 2 2 unless $smtp->quit