Thank you for helping. Can you explain me in the context of writing a test for this function: https://github.com/JuliaStats/StatsBase.jl/blob/master/src/sampling.jl#L77-L81
Can it be possible to write tests for this using the Base.Test package? How do I use srand() implementation for writing a test to this? Sorry for a lot of questions. Was trying to get my head around Base.Test! regards, Raj On Monday, March 14, 2016 at 5:07:29 PM UTC+5:30, Milan Bouchet-Valat wrote: > > Le lundi 14 mars 2016 à 04:19 -0700, RAJ Rohit Jalem a écrit : > > How do I test functions that return random values. > > > > For example, this function here: https://coveralls.io/builds/5402764/ > > source?filename=src%2Fsampling.jl#L77 > > > > Can it be done with the Base.Test package? If yes, then how? > Use srand() before calling them to ensure you always get the same > "random" value. For example, srand(1) will work. > > > Regards >
