Branch Coverage

blib/lib/Mail/LocalDelivery.pm
Criterion Covered Total %
branch 60 116 51.7


line true false branch
25 34 0 if $$self{'logger'}
26 0 0 if $debuglevel < $priority
50 0 1 if (eval { do { $stuff->isa('Mail::Internet') } }) { }
0 1 elsif (my $email = eval { do { 'Email::Abstract'->new($self) } }) { }
1 0 elsif (ref $stuff eq 'ARRAY' or ref $stuff eq 'GLOB') { }
80 0 3 if ($$self{'interpolate_strftime'} and grep {/%/;} @out)
99 1 2 unless @files
137 9 3 unless @{$deliver_types{$deliver_type};}
145 0 3 unless $self->can($deliver_handler)
151 1 2 if (@actually_saved_to_files == 0)
160 0 1 if (not defined $emergency) { }
163 0 1 if (grep(($emergency eq $_), @files)) { }
169 0 1 unless @actually_saved_to_files
180 0 4 if $file =~ m[/$]
181 0 4 if $file =~ m[/\.$]
183 2 2 if (-d $file)
184 0 2 if -d "$file/tmp" and -d "$file/new"
185 0 2 if (exists $$self{'ASSUME_MSGPREFIX'})
186 0 0 if $$self{'ASSUME_MSGPREFIX'}
189 0 2 if $ASSUME_MSGPREFIX
200 0 2 if (ref $$arg[0] eq 'HASH') { }
0 2 elsif (ref $$arg[-1] eq 'HASH') { }
201 0 0 unless @$arg == 1
219 1 1 if (my $mkdir_error = $self->_mkdir_p(dirname($file)))
233 1 0 if (not $error) { }
248 0 3 unless defined $$write_opts{'need_from'}
249 0 3 unless defined $$write_opts{'need_lock'}
250 2 1 unless defined $$write_opts{'extra_newline'}
254 0 3 unless (open FH, ">>$file")
258 1 2 if ($$write_opts{'need_lock'})
260 0 1 if $lock_error
265 0 3 if (not $$write_opts{'need_from'} and $$self{'email'}->head->header->[0] =~ /^From\s/)
274 1 2 if ($$write_opts{'need_from'} and not $$self{'email'}->head->header->[0] =~ /^From\s/)
279 0 1 if (exists $ENV{'UFLINE'}) { }
301 0 1 if $from =~ /<(.*?)>/
317 0 3 unless print FH $$self{'email'}->as_string
320 1 0 if $$write_opts{'extra_newline'} or return "couldn't write to ${file}: $!"
324 1 0 if ($$write_opts{'need_lock'})
325 0 1 unless flock FH, 8
328 0 1 unless close FH
352 1 1 unless (length($$self{'email'}->get('Lines') || ''))
358 1 1 if ($maildir_time != time) { }
375 0 2 $$self{'one_for_all'} ? :
388 0 2 $$self{'one_for_all'} ? :
0 2 if (my $mkdir_error = $self->_mkdir_p($$self{'one_for_all'} ? $file : map({"$file/$_";} 'tmp', 'new', 'cur')))
408 0 2 unless $error
416 2 0 unless ($tmp_path)
428 0 0 $$self{'one_for_all'} ? :
437 0 0 $$self{'one_for_all'} ? :
0 0 if (my $mkdir_error = $self->_mkdir_p($$self{'one_for_all'} ? $file : map({"$file/$_";} 'tmp', 'new', 'cur')))
452 0 0 if (link $tmp_path, $new_path) { }
456 0 0 if ($! == &EXDEV) { }
469 0 0 unless unlink $tmp_path
480 1 0 if (flock $FH, 2) { }
484 0 0 if sleep $_
494 0 4 unless @_
497 1 7 if -d $path
500 1 6 if $@