Branch Coverage

lib/Sisimai/Lhost/SendGrid.pm
Criterion Covered Total %
branch 40 52 76.9


line true false branch
21 86 137 unless $mhead->{'return-path'}
22 121 16 unless $mhead->{'return-path'} eq ""
23 0 16 unless $mhead->{'subject'} eq "Undelivered Mail Returned to Sender"
44 48 293 unless ($readcursor)
46 16 32 if index($e, $startingof->{'message'}[0]) == 0
49 0 293 unless $readcursor & $indicators->{'deliverystatus'}
50 80 213 unless length $e
52 96 117 if (my $f = 'Sisimai::RFC1894'->match($e)) { }
57 21 75 unless ($o)
61 16 5 if $e =~ /\ADiagnostic-Code:[ ]*(.+)/
65 32 43 if ($o->[-1] eq 'addr') { }
0 43 elsif ($o->[-1] eq 'code') { }
16 27 elsif ($o->[-1] eq 'date') { }
68 16 16 if ($o->[0] eq 'final-recipient') { }
70 0 16 if ($v->{'recipient'})
89 0 16 unless $e =~ /\AArrival-Date: (\d{4})[-](\d{2})[-](\d{2}) (\d{2})[-](\d{2})[-](\d{2})\z/
96 0 27 unless exists $$fieldtable{$o->[0]}
99 27 0 unless $f == 1
121 11 106 if ($e =~ /.+ in (?:End of )?([A-Z]{4}).*\z/) { }
127 101 5 unless index($p, "Diagnostic-Code:") == 0
128 0 5 unless $e =~ /\A[ \t]+(.+)\z/
136 0 16 unless $recipients
141 11 5 if $e->{'diagnosis'} =~ /\b([45])\d\d[ \t]*/
143 11 5 if ($e->{'status'} eq "5.0.0" or $e->{'status'} eq "4.0.0")
149 0 16 if ($e->{'action'} eq "expired")
152 0 0 if (not $e->{'status'} or substr($e->{'status'}, -4, 4) eq ".0.0")