Branch Coverage

blib/lib/Mail/Header.pm
Criterion Covered Total %
branch 69 168 41.0


line true false branch
36 0 0 if defined $self->{'mail_hdr_list'}[$i]
43 0 0 if ($deleted)
49 0 0 if ref $_
0 0 unless @$ref = grep({defined $$_ if ref $_;} @$ref)
74 0 27 if $maxlen < 20
83 0 27 if $_[0] =~ /^From\s/io
85 14 13 if (length $_[0] > $maxlen)
86 9 5 if ($_[0] =~ /^([-\w]+)/ and exists $STRUCTURE{lc $1}) { }
125 3 66 /^[b-df-hj-np-tv-z]+$|^(?:MIME|SWE|SOAP|LDAP|ID)$/i ? :
141 0 25 unless defined $tag
144 0 25 if (defined $tag and $tag =~ /^From /io and $self->{'mail_hdr_mail_from'} ne 'KEEP')
145 0 0 if ($self->{'mail_hdr_mail_from'} eq 'COERCE') { }
0 0 elsif ($self->{'mail_hdr_mail_from'} eq 'IGNORE') { }
0 0 elsif ($self->{'mail_hdr_mail_from'} eq 'ERROR') { }
157 25 0 if (defined $tag)
159 9 16 if $modify
160 25 0 if defined $ctag
163 0 25 unless defined $ctag and $ctag =~ /^($FIELD_NAME|From )/io
167 15 10 if (defined $ctag and $modify || !($line =~ /^\Q$ctag\E/i))
176 9 16 if ($modify and defined $maxlen) { }
1 15 elsif ($line =~ /\r?\n\S/) { }
193 24 0 if ($where < 0) { }
0 0 elsif ($where >= @{$self->{'mail_hdr_list'};}) { }
195 0 24 if $where < 0
208 18 6 if ($def and $where) { }
209 18 0 if ($atend) { }
214 0 0 if $r == $ref
215 0 0 if $r == $def->[$i]
230 5 6 @_ % 2 ? :
234 8 3 unless exists $opt{'Modify'}
247 0 11 if exists $opt{'FoldLength'}
249 6 5 if (not ref $arg) { }
5 0 elsif (ref $arg eq 'ARRAY') { }
0 0 elsif (defined fileno $arg) { }
282 2 19 if $line =~ /^\r?$/
284 0 19 unless $line =~ /^($FIELD_NAME|From )/o
292 18 1 if defined $line
308 0 0 if (defined $ln and defined $line and $ln =~ /^[ \t]+/)
313 0 0 if (defined $line)
315 0 0 if defined $line
320 0 0 if not defined $ln or $ln =~ /^\r?$/
322 0 0 unless $ln =~ /^($FIELD_NAME|From )/o
341 1 0 if @_
345 0 1 if $self->{'mail_hdr_modify'}
355 1 1 ref $value ? :
359 0 2 if $self->{'mail_hdr_modify'}
362 1 1 unless defined wantarray
375 3 0 if @_
386 0 11 unless $choice =~ /^(IGNORE|ERROR|COERCE|KEEP)$/
389 11 0 if (ref $thing) { }
400 0 28 if (@_ == 2) { }
404 0 0 ref $thing ? :
406 0 0 $len > 20 ? :
413 3 25 if (defined $len)
414 3 0 $len > 20 ? :
415 0 3 if $self->{'mail_hdr_modify'}
434 18 0 if defined $ln
446 0 1 if (@_)
448 0 0 unless my $list = $self->{'mail_hdr_hash'}{$tag}
452 0 0 if defined $ln and defined $$ln
461 6 0 if defined $ln and defined $$ln
474 0 6 unless defined $tag and defined $line
477 6 0 unless defined $where
489 0 0 @_ % 2 ? :
496 0 0 unless defined $tag and defined $line
500 0 0 if ($field and defined $field->[$idx]) { }
515 0 0 if $tag =~ /^From /io and $self->{'mail_hdr_mail_from'} ne 'KEEP'
518 0 0 unless my $def = $self->{'mail_hdr_hash'}{$tag}
521 0 0 if @$def <= 1
539 3 23 unless my $def = $self->{'mail_hdr_hash'}{$tag}
543 23 0 unless $tag =~ / $/o
545 20 3 if (defined $idx or not wantarray)
547 0 20 unless defined $def->[$idx]
549 0 20 unless defined $val
565 0 0 defined $def ? :
576 0 2 if (my $def = $self->{'mail_hdr_hash'}{$tag})
578 0 0 unless $tag =~ / $/
580 0 0 if (defined $idx) { }
581 0 0 if (defined $def->[$idx])
603 0 6 unless defined $ln
604 0 6 unless print $fd $ln
621 0 0 @_ ? :
624 0 0 if $$field =~ /^\S+\s+\S/s
630 0 0 if $deleted