File: randnum.t

package info (click to toggle)
libmath-randomorg-perl 0.04-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 160 kB
  • sloc: perl: 743; makefile: 4
file content (17 lines) | stat: -rw-r--r-- 311 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use strict;
use Test;
use Math::RandomOrg qw(randnum randbyte);

BEGIN {
	plan tests => (3*3*20)
}

foreach my $max (1, 1_000, 1_000_000_000) {
	foreach my $min (1, 0, -1_000_000_000) {
		for (1 .. 20) {
			my $number	= randnum( $min, $max );
			($number >= $min and $number <= $max) ? ok(1) : ok(0);
		}
	}
}