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
68
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
     1
use strict;
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
     2
use warnings;
58
27440e1334b7 Use lib/ and ExtUtils::MakeMaker
heiko
parents:
diff changeset
     3
use Test::More qw(no_plan);
68
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
     4
use File::Temp;
58
27440e1334b7 Use lib/ and ExtUtils::MakeMaker
heiko
parents:
diff changeset
     5
68
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
     6
use_ok 'Exim::Grey' => qw(unseen)
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
     7
  or BAIL_OUT;
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
     8
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
     9
my $db = File::Temp->new();
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
    10
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
    11
is unseen('a->b', 1, "$db"), 'yes' => 'unseen a->b';
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
    12
is unseen('a->b', 1, "$db"), 'yes' => 'unseen a->b';
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
    13
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
    14
is unseen('x->y/1.1.1.1', 1, "$db"), 'yes' => 'unseen x->y/1.1.1.1';
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
    15
is unseen('x->y/1.1.1.1', 1, "$db"), 'yes' => 'unseen x->y/1.1.1.1';
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
    16
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
    17
# sleep
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
    18
is unseen('a->b',     0, "$db"), 'no' => 'seen a->b';
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
    19
is unseen('x->y/1.1.1.1', 0, "$db"), 'no' => 'seen x->y/1.1.1.1';
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
    20
is unseen('x->z/1.1.1.1', 0, "$db"), 'no' => 'seen x->z/1.1.1.1';
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
    21
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
    22
is unseen('a->b', 600, "$db"), 'yes' => 'unseen a->b with 600s delay';