File: 04-yahoo.t

package info (click to toggle)
libmail-authenticationresults-perl 2.20230112-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 364 kB
  • sloc: perl: 2,803; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 639 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!perl
use 5.008;
use strict;
use warnings FATAL => 'all';
use lib 't';
use Test::More;
use Test::Exception;

use lib 'lib';
use Mail::AuthenticationResults::Parser;

my $ARHeader = 'Authentication-Results: mta4011.mail.gq1.yahoo.com  from=fastmail.com; domainkeys=neutral (no sig);  from=messagingengine.com; dkim=pass (ok)';

my $Parsed;
lives_ok( sub{ $Parsed = Mail::AuthenticationResults::Parser->new()->parse( $ARHeader ) }, 'Parse lives' );

is ( $Parsed->value()->value(), 'mta4011.mail.gq1.yahoo.com', 'ServID' );
is ( scalar @{$Parsed->search({ 'key'=>'dkim','value'=>'pass' })->children() }, 1, 'DKIM Pass' );

done_testing();