ts <decoux / moulon.inra.fr> writes:

> >>>>> "D" == Dave Thomas <Dave / thomases.com> writes:
> 
> D> I'm looking for a couple of unit tests for Ruby's random number
> D> generator. 
> 
>  ruby use the generator of the system (rand48() or rand()), these
>  generators are well known. 

I know, but... I still need to test that it's manipulating the results
correctly and not introducing any bias or other errors. For example,
if the value of RANDOM_MAX in random.c is wrong, then rand(0) may
return numbers in the wrong range. Similarly, there are divisions and
multiplications of the results which have the potential for off-by-one
errors (I'm sure they're actually correct, but we're writing tests so
we have to be pessimistic).

So... I feel that to be thorough I need to test the numbers returned.
Trust me--I'd rather not ;-)


Dave