summaryrefslogtreecommitdiffstats
path: root/debian/perl-framework/t/modules/unique_id.t
blob: a3f206b7951824d8a98537cc0b14c0ad31147e55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use strict;
use warnings FATAL => 'all';

use Apache::Test;
use Apache::TestRequest;
use Apache::TestUtil;

## 
## mod_unique_id tests
##

my $iters = 100;
my $url = "/modules/cgi/unique-id.pl";
my %idx = ();

plan tests => 3 * $iters, need need_cgi, need_module('unique_id');

foreach (1..$iters) {
    my $r = GET $url;
    ok t_cmp($r->code, 200, "fetch unique ID");
    my $v = $r->content;
    print "# unique id: $v\n";
    chomp $v;
    ok length($v) >= 20;
    ok !exists($idx{$v});
    $idx{$v} = 1;
}