Re: Generating varying sized map using test.check

2015-07-27 Thread Mayank Jain
> > On 27 July 2015 at 18:10, Carlo Zancanaro > wrote: > >> You're generating two random things: the map, and the subset of the keys. >> You can't generate the subset of the keys without first knowing the full >> set of keys, so bind lets you make the subset generator depend on the >> result of th

Re: Generating varying sized map using test.check

2015-07-27 Thread Carlo Zancanaro
Whoops, forgot the group on this. On 27 July 2015 at 18:10, Carlo Zancanaro wrote: > You're generating two random things: the map, and the subset of the keys. > You can't generate the subset of the keys without first knowing the full > set of keys, so bind lets you make the subset generator depe

Re: Generating varying sized map using test.check

2015-07-27 Thread Mayank Jain
> It also might be helpful to know that there is already a subset generator > available in this library > . > Thanks, this looks good, will check it out. > What you've done here might appear to work, but it will get you into >> trouble

Re: Generating varying sized map using test.check

2015-07-25 Thread Gary Fredericks
It also might be helpful to know that there is already a subset generator available in this library . Gary On Saturday, July 25, 2015 at 6:54:59 PM UTC-5, Carlo wrote: > > Hey Mayank! > > What you've done here might appear to work, but it wi

Re: Generating varying sized map using test.check

2015-07-25 Thread Carlo Zancanaro
Hey Mayank! What you've done here might appear to work, but it will get you into trouble when test.check starts to shrink your inputs. When test.check runs your generators it relies you you using it as your only source of randomness, and so your use of `rand-int` will cause some problems. The tri

Generating varying sized map using test.check

2015-07-25 Thread Mayank Jain
Hi, I would like to generate variable sized map using test.check i.e. given any generator which generates a map, it should randomly select-keys from it. Here's what I've come up with so far: > (ns proj.util (:require [clojure.test.check.generators :as gen] [clojure.math.combinat