Branch Coverage

blib/lib/Mail/GPG/Test.pm
Criterion Covered Total %
branch 76 132 57.5


line true false branch
22 1 5 if (not -d $DUMPDIR)
23 0 1 unless File::Path::make_path($DUMPDIR)
40 53 74 $_[0]->get_use_long_key_ids ? :
42 12 18 $_[0]->get_use_long_key_ids ? :
133 12 42 if ($modify)
134 0 12 unless open $fh, $file
139 0 12 unless open $fh, ">$file"
144 0 54 unless open $fh, $file
157 16 8 unless defined $attach
158 0 24 unless defined $invalid
160 8 16 if $attach
161 12 12 unless $invalid
162 12 12 if $invalid
174 8 16 if ($attach)
185 0 24 unless ($mg->is_signed('entity', $signed_entity))
197 0 24 if ($ENV{'DUMPFILES'})
198 0 0 $attach ? :
0 0 $invalid ? :
212 10 2 unless ($invalid or $encoding eq 'base64' and $method eq 'armor_sign')
214 0 10 unless ('Mail::GPG'->is_signed('entity', $signed_entity))
218 0 10 unless ('Mail::GPG'->is_signed_quick('mail_sref', \$signed_entity_string))
226 0 10 unless open TMP, "+>$tmp_file"
228 0 10 unless ('Mail::GPG'->is_signed_quick('mail_fh', \*TMP))
242 0 12 if (not $invalid and $@)
247 0 12 if (not $invalid and $result->get_sign_key_id ne $self->get_key_id || $result->get_sign_mail ne $self->get_key_mail)
255 0 24 if (not $invalid and $result->get_sign_trust ne '-')
259 12 12 if ($invalid) { }
260 2 10 if ($error) { }
280 8 16 if $attach
281 16 8 unless defined $attach
291 8 16 if ($attach)
305 0 24 unless ($mg->is_encrypted('entity', $enc_entity))
317 24 0 if ($has_encode) { }
318 0 24 if ($dec_key_id ne $self->get_key_id)
326 0 24 if ($dec_key_mail ne $self->get_key_mail)
336 0 0 if ($dec_key_id ne $self->get_key_id)
348 0 24 if ($ENV{'DUMPFILES'})
349 0 0 $attach ? :
356 0 12 if ($method =~ /encrypt/ and not $method =~ /sign/ and $result->get_is_signed || $result->get_sign_key_id || $result->get_sign_mail || $result->get_sign_ok)
367 0 24 if ($method =~ /sign/ and not $result->get_sign_ok && $result->get_is_signed && $result->get_sign_key_id eq $self->get_key_id && $result->get_sign_mail eq $self->get_key_mail)
377 24 0 if ($has_encode) { }
378 0 24 unless ($result->get_is_encrypted and $result->get_enc_ok and $result->get_enc_key_id eq $self->get_key_sub_id and $result->get_enc_mail eq $self->get_key_mail)
387 0 0 unless ($result->get_is_encrypted and $result->get_enc_ok and $result->get_enc_key_id eq $self->get_key_sub_id)
394 8 16 if ($method =~ /armor/) { }
8 8 elsif (not $attach) { }
398 0 8 if ($ENV{'DUMPFILES'})
406 0 8 if ($ENV{'DUMPFILES'})
419 0 8 if ($ENV{'DUMPFILES'})
425 0 24 if ($ENV{'DUMPFILES'})
455 0 6 if ($TIMEIT)
464 0 6 if ($TIMEIT)
468 0 6 unless ($mg->is_encrypted('entity', $enc_entity))
473 0 6 if ($TIMEIT)
480 0 6 if ($TIMEIT)
485 0 6 if ($TIMEIT)
491 0 6 if ($TIMEIT)
496 6 0 if ($has_encode) { }
497 0 6 if ($dec_key_id ne $self->get_key_id)
505 0 6 if ($dec_key_mail ne $self->get_key_mail)
516 0 0 if ($dec_key_id ne $self->get_key_id)
525 0 6 if ($TIMEIT)
531 0 6 if ($TIMEIT)
535 0 6 unless ($result->get_sign_ok and $result->get_is_signed and $result->get_sign_key_id eq $self->get_key_id and $result->get_sign_mail eq $self->get_key_mail)
543 6 0 if ($has_encode) { }
544 0 6 unless ($result->get_is_encrypted and $result->get_enc_ok and $result->get_enc_key_id eq $self->get_key_sub_id and $result->get_enc_mail eq $self->get_key_mail)
553 0 0 unless ($result->get_is_encrypted and $result->get_enc_ok and $result->get_enc_key_id eq $self->get_key_sub_id)