You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a user of the library, I would like to be able to generate random test images but do so in a deterministic way. I would like to have options from the random.Index(), random.Image(), and random.Layer() functions that allow me to set the rand.Source or the seed to use.
During unit testing I find the random images useful however they are always different (even when I am re-running a test) so it is a larger cognitive load to track what is happening in my test. I cannot add a conditional break-point on the sha256 in one of these images. I do not care what the digest is or what the contents of the images are, I just want them to stay constant unless I change the seed.
The only place a random number generator is used is in Layer() and actually two different random number generators are called. crypto/rand (for the io.Reader interface) and math/rand (for an integer).
The text was updated successfully, but these errors were encountered:
As a user of the library, I would like to be able to generate random test images but do so in a deterministic way. I would like to have options from the random.Index(), random.Image(), and random.Layer() functions that allow me to set the
rand.Source
or the seed to use.During unit testing I find the random images useful however they are always different (even when I am re-running a test) so it is a larger cognitive load to track what is happening in my test. I cannot add a conditional break-point on the sha256 in one of these images. I do not care what the digest is or what the contents of the images are, I just want them to stay constant unless I change the seed.
The only place a random number generator is used is in Layer() and actually two different random number generators are called.
crypto/rand
(for the io.Reader interface) andmath/rand
(for an integer).The text was updated successfully, but these errors were encountered: