t/00-basic.t
changeset 68 8bc711bdd180
parent 58 27440e1334b7
child 71 46ba051d29bd
equal deleted inserted replaced
67:da29842506b4 68:8bc711bdd180
       
     1 use strict;
       
     2 use warnings;
     1 use Test::More qw(no_plan);
     3 use Test::More qw(no_plan);
       
     4 use File::Temp;
     2 
     5 
     3 use_ok 'Exim::Grey' => qw(unseen);
     6 use_ok 'Exim::Grey' => qw(unseen)
       
     7   or BAIL_OUT;
       
     8 
       
     9 my $db = File::Temp->new();
       
    10 
       
    11 is unseen('a->b', 1, "$db"), 'yes' => 'unseen a->b';
       
    12 is unseen('a->b', 1, "$db"), 'yes' => 'unseen a->b';
       
    13 
       
    14 is unseen('x->y/1.1.1.1', 1, "$db"), 'yes' => 'unseen x->y/1.1.1.1';
       
    15 is unseen('x->y/1.1.1.1', 1, "$db"), 'yes' => 'unseen x->y/1.1.1.1';
       
    16 
       
    17 # sleep
       
    18 is unseen('a->b',     0, "$db"), 'no' => 'seen a->b';
       
    19 is unseen('x->y/1.1.1.1', 0, "$db"), 'no' => 'seen x->y/1.1.1.1';
       
    20 is unseen('x->z/1.1.1.1', 0, "$db"), 'no' => 'seen x->z/1.1.1.1';
       
    21 
       
    22 is unseen('a->b', 600, "$db"), 'yes' => 'unseen a->b with 600s delay';