[Newbies] Generating a predictable 'atRandom' result for testing

Kyle Hamilton aerowolf at gmail.com
Mon Aug 13 00:08:54 UTC 2007


If you can test it for lack-of-randomness, I would presume that  
you're not trying to test the randomness.

I would create a wrapper to 'get number' -- if the test harness is  
loaded and a flag is set, have that wrapper return an entry from an  
array or such, and if not, use atRandom.

-Kyle H

On Aug 12, 2007, at 11:51 AM, John Almberg wrote:

> I'm trying to write a test for a method that uses atRandom to  
> choose a random integer. Is there a way to seed the random number  
> generator to generate a predictable sequence of numbers, so I end  
> up with testable results?
>
> TIA: John
>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners



More information about the Beginners mailing list