diff options
Diffstat (limited to 'debian/perl-framework/t/modules/unique_id.t')
-rw-r--r-- | debian/perl-framework/t/modules/unique_id.t | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/debian/perl-framework/t/modules/unique_id.t b/debian/perl-framework/t/modules/unique_id.t new file mode 100644 index 0000000..a3f206b --- /dev/null +++ b/debian/perl-framework/t/modules/unique_id.t @@ -0,0 +1,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; +} |