dmarc test: comments in the public list was

allowing certain org domain searches to fail (plus.google.com, b/c a google.com email address was in the public list). Now I anchor the searches to the start of the line. This test also catches edge cases like co.uk, which isn't listed, but a wildcard *.uk is.
This commit is contained in:
Matt Simerson 2013-04-24 16:33:57 -04:00
parent 3d6f23fcfd
commit 8823de5075

View File

@ -12,7 +12,7 @@ my $test_email = 'matt@tnpi.net';
sub register_tests {
my $self = shift;
$self->register_test('test_get_organizational_domain', 2);
$self->register_test('test_get_organizational_domain', 3);
$self->register_test("test_fetch_dmarc_record", 3);
$self->register_test("test_discover_policy", 1);
}
@ -55,7 +55,8 @@ sub test_get_organizational_domain {
my $transaction = $self->qp->transaction;
cmp_ok( $self->get_organizational_domain('test.www.tnpi.net'), 'eq', 'tnpi.net' );
cmp_ok( $self->get_organizational_domain('www.example.co.uk'), 'eq', 'example.co.uk' )
cmp_ok( $self->get_organizational_domain('www.example.co.uk'), 'eq', 'example.co.uk' );
cmp_ok( $self->get_organizational_domain('plus.google.com'), 'eq', 'google.com' );
};
sub test_discover_policy {