t/00-basic.t
author Heiko Schlittermann <hs@schlittermann.de>
Thu, 02 Jun 2016 22:17:27 +0200
changeset 68 8bc711bdd180
parent 58 27440e1334b7
child 71 46ba051d29bd
permissions -rw-r--r--
Add more tests
use strict;
use warnings;
use Test::More qw(no_plan);
use File::Temp;

use_ok 'Exim::Grey' => qw(unseen)
  or BAIL_OUT;

my $db = File::Temp->new();

is unseen('a->b', 1, "$db"), 'yes' => 'unseen a->b';
is unseen('a->b', 1, "$db"), 'yes' => 'unseen a->b';

is unseen('x->y/1.1.1.1', 1, "$db"), 'yes' => 'unseen x->y/1.1.1.1';
is unseen('x->y/1.1.1.1', 1, "$db"), 'yes' => 'unseen x->y/1.1.1.1';

# sleep
is unseen('a->b',     0, "$db"), 'no' => 'seen a->b';
is unseen('x->y/1.1.1.1', 0, "$db"), 'no' => 'seen x->y/1.1.1.1';
is unseen('x->z/1.1.1.1', 0, "$db"), 'no' => 'seen x->z/1.1.1.1';

is unseen('a->b', 600, "$db"), 'yes' => 'unseen a->b with 600s delay';