Branch Coverage

blib/lib/Mail/MboxParser.pm
Criterion Covered Total %
branch 57 104 54.8


line true false branch
222 0 17 if (@args == 0)
230 0 17 if (@args % 2 == 0)
267 17 0 if (not ref $source) { }
0 0 elsif (ref $source eq 'GLOB' and seek $source, 0, 1) { }
268 0 17 unless (-f $source)
274 0 17 unless CORE::open $handle, "<$source"
288 0 0 unless (my $fh, $file_name) = tempfile('UNLINK', 1)
291 0 0 if (ref $source eq 'SCALAR') { }
0 0 elsif (ref $source eq 'ARRAY') { }
0 0 elsif (ref $source eq 'GLOB') { }
298 17 0 if ($$self{'CONFIG'}{'oldparser'} or 1 or not defined $file_name) { }
317 0 0 unless exists $$self{'enable_grep'}
319 0 0 if ($$opts{'enable_grep'})
321 0 0 if $@
323 0 0 if ($$opts{'enable_cache'})
324 0 0 unless exists $$opts{'cache_file_name'}
326 0 0 if $@
330 0 0 if $$opts{'enable_cache'}
336 0 0 unless (ref($$self{'PARSER'} = 'Mail::Mbox::MessageParser'->new($opts)))
350 17 0 unless (exists $$self{'CONFIG'}{'newline'})
355 0 17 if ($nl eq 'UNIX') { }
0 17 elsif ($nl eq 'WIN') { }
17 0 elsif ($nl eq 'AUTO') { }
361 17 0 unless $$self{'PARSER'}
421 9 7345 if (not $in_body and /$from_date/)
426 73 7281 if ($in_header and /$empty_line/)
433 73 7281 if (/$from_date/ || eof and $got_header)
434 9 64 if eof
442 7354 0 if ($_)
443 2430 4924 if $in_header and not $got_header
444 4916 2438 if $in_body and $got_header
448 0 9 if (exists $$self{'CONFIG'}{'decode'})
482 6 32 unless exists $$self{'MSG_IDX'}
487 0 38 if (my $err = $self->error)
520 0 0 if ref \$p eq 'SCALAR' or $p->end_of_file
557 74 8084 if eof $h || /$empty_line/ and $in_header
559 152 8006 if (/$from_date/ or eof $h)
560 14 138 if eof $h
561 78 74 if (not $got_header) { }
570 1642 6442 if (/$empty_line/ and $got_header)
575 2480 5604 if $in_header
576 5600 2484 if $in_body
703 54 5388 if /$from_date/
730 38 0 if (exists $$self{'MSG_IDX'}) { }
731 0 38 unless (exists $$self{'MSG_IDX'}{$num})
758 0 14 unless ($$self{'READER'})
759 12 2 unless ($$self{'NMSGS'})
764 108 10776 if /$from_date/
799 1 47 if (ord $c == 13) { }
16 31 elsif (ord $c == 10) { }
802 1 0 if ord $next == 10
818 17 0 if defined $$self{'READER'}