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
Sometimes I want to control a generator based on the value generated from another. A simple case is where some value should be one of several subclasses. For example flatMap on generators would allow an integer to be generated, and one of the subclasses generated based on the value of the integer.
Something like:
class Data {}
class A extends Data {}
class B extends Data {}
class C extends Data {}
class DataContainer { Data data }
Gen.type(DataContainer,
data: Gen.integer(0..2).flatMap{ Gen.type([A,B,C][it]) }
)
The text was updated successfully, but these errors were encountered:
Interesting, I have been swamped with work and home stuff recently so I apologize for not getting to this sooner. I will have some time this weekend to think about an implementation unless you have already thought about how you might accomplish this.
Sometimes I want to control a generator based on the value generated from another. A simple case is where some value should be one of several subclasses. For example
flatMap
on generators would allow an integer to be generated, and one of the subclasses generated based on the value of the integer.Something like:
The text was updated successfully, but these errors were encountered: