[Newbies] Generating a predictable 'atRandom' result for testing
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.
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
More information about the Beginners