t/00-basic.t
author Heiko Schlittermann <hs@schlittermann.de>
Sat, 04 Jun 2016 22:08:13 +0200
changeset 71 46ba051d29bd
parent 68 8bc711bdd180
child 72 f095f28db247
permissions -rw-r--r--
[perltidy] test
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;
71
46ba051d29bd [perltidy] test
Heiko Schlittermann <hs@schlittermann.de>
parents: 68
diff changeset
     3
58
27440e1334b7 Use lib/ and ExtUtils::MakeMaker
heiko
parents:
diff changeset
     4
use Test::More qw(no_plan);
68
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
     5
use File::Temp;
58
27440e1334b7 Use lib/ and ExtUtils::MakeMaker
heiko
parents:
diff changeset
     6
71
46ba051d29bd [perltidy] test
Heiko Schlittermann <hs@schlittermann.de>
parents: 68
diff changeset
     7
use_ok 'Exim::Grey' => qw(unseen seen) or BAIL_OUT;
68
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
71
46ba051d29bd [perltidy] test
Heiko Schlittermann <hs@schlittermann.de>
parents: 68
diff changeset
    11
is seen('a->x', 1, "$db"), 'no' => 'not seen a->x';
68
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
is unseen('a->b', 1, "$db"), 'yes' => 'unseen a->b';
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
    14
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
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
    17
71
46ba051d29bd [perltidy] test
Heiko Schlittermann <hs@schlittermann.de>
parents: 68
diff changeset
    18
is unseen('a->b',         0, "$db"), 'no' => 'not unseen a->b';
46ba051d29bd [perltidy] test
Heiko Schlittermann <hs@schlittermann.de>
parents: 68
diff changeset
    19
is unseen('x->y/1.1.1.1', 0, "$db"), 'no' => 'not unseen x->y/1.1.1.1';
46ba051d29bd [perltidy] test
Heiko Schlittermann <hs@schlittermann.de>
parents: 68
diff changeset
    20
is unseen('x->z/1.1.1.1', 0, "$db"), 'no' => 'not unseen x->z/1.1.1.1';
46ba051d29bd [perltidy] test
Heiko Schlittermann <hs@schlittermann.de>
parents: 68
diff changeset
    21
is seen('x->z/1.1.1.1', 0, "$db"), 'yes' => 'seen x->z/1.1.1.1';
68
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
    22
8bc711bdd180 Add more tests
Heiko Schlittermann <hs@schlittermann.de>
parents: 58
diff changeset
    23
is unseen('a->b', 600, "$db"), 'yes' => 'unseen a->b with 600s delay';
71
46ba051d29bd [perltidy] test
Heiko Schlittermann <hs@schlittermann.de>
parents: 68
diff changeset
    24
is seen('a->b', 600, "$db"), 'no' => 'not seen a->b with 600s delay';