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
In release 0.15, you could do something like integers().between(1, 100).andAlwaysTheValues(2560)
if you have implemented the interface WithQuickTheories
How do you do something similar in release 0.20? The method Gen<Integer>.andAlwaysTheValues(Integer) seem to have disapeared in release 0.20, and using integers().between(1, 100).mix(arbitrary().constant(2560)) does not give the same result.
The text was updated successfully, but these errors were encountered:
At the moment there isn't a way to do this in 0.20 - the way values are now generated makes this hard - it would require a way to convert from a given type to a long array that matches the precursor the generator would produce for that value.
This would be possible to do for some simple types such as integer, longs etc, but not generally possible.
I think the general solution would be something similar to what you tried with mix - it could perhaps be extended to allow the mixed generators to be weighted by differing amounts.
Allowing some deterministic behaviour (such as always generating certain values) caused unexpected issues in 0.15 (such as shrinking getting stuck in loops), so unless there is a strong use case I'd prefer to support mixing with a high probability of including a value rather than a guarantee.
In release 0.15, you could do something like
integers().between(1, 100).andAlwaysTheValues(2560)
if you have implemented the interface
WithQuickTheories
How do you do something similar in release 0.20? The method
Gen<Integer>.andAlwaysTheValues(Integer)
seem to have disapeared in release 0.20, and usingintegers().between(1, 100).mix(arbitrary().constant(2560))
does not give the same result.The text was updated successfully, but these errors were encountered: