File: 9.t

package info (click to toggle)
libmath-random-mt-perl 1.17-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 140 kB
  • sloc: ansic: 216; perl: 63; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 541 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use Test::More;
use Benchmark qw(timediff timestr);
BEGIN {
   use_ok('Math::Random::MT', qw(srand));
}


# Make sure that automatic seeds generated close in time are different.

my ($autoseed1, $autoseed2, $autoseed3, $autoseed4);

# Generate a series of 3 random numbers using an autogenerated seed
ok $autoseed1 = srand();
ok $autoseed2 = srand();
ok $autoseed3 = srand();
ok $autoseed4 = srand();
cmp_ok $autoseed1, '!=', $autoseed2;
cmp_ok $autoseed2, '!=', $autoseed3;
cmp_ok $autoseed3, '!=', $autoseed4;

done_testing();