Prior to this change, gen.Struct produced a value by ranging over
items in a map, which in turn draws values from the gopter.Gens from
the items, which in turn presumedly makes calls to the PRNG in the
gopter.GenParameters. Ranging over items in a map is intentionally
non-deterministic, therefore the calls to the PRNG is also
non-deterministic.
This change extracts the keys from the map, sorts them and then ranges
over the keys. This ensures that the calls to PRNG is deterministic.
Prior to this change,
gen.Struct
produced a value by ranging over items in a map, which in turn draws values from thegopter.Gen
s from the items, which in turn presumedly makes calls to the PRNG in thegopter.GenParameters
. Ranging over items in a map is intentionally non-deterministic, therefore the calls to the PRNG is also non-deterministic.This change extracts the keys from the map, sorts them and then ranges over the keys. This ensures that the calls to PRNG is deterministic.
fixes #44