How can I test that a method generating random numbers actually generates random numbers? Is there some ($tested_method, rand)
sort of syntax?
Specifically, I'm referring to this ping generator method:
sub _create_ping_number {
my ( $ping, @random_array );
my $MAX = 100000;
my $random_counter = 0;
if ( $random_counter == $MAX ) {
@random_array = ();
$random_counter = 0;
}
until ( !undef( $random_array[ $ping = int( rand($MAX) ) ] ) ) { }
$random_array[$ping] = 1;
$random_counter++;
return $ping;
}