leanovate / gopter

GOlang Property TestER
MIT License
599 stars 40 forks source link

Add ability to override type generated in gen.SliceOf(...) #41

Closed prateek closed 6 years ago

prateek commented 6 years ago

I have a situation where I need to override the type of the slice generated when using gen.SliceOf:

I'd like to use to gen.SliceOf(gen.OneOf(genX(), genY())) to generate a []A, to do so I have to provide an override for the type to SliceOf. This PR adds this functionality.

untoldwind commented 6 years ago

I don't have a good idea how to solve this problem any better way.

prateek commented 6 years ago

@untoldwind much appreciated mate!