I'm having trouble doing some seemingly basic stuff with test.check. Can someone point out where I'm going wrong?
Basically bind
and large-integer*
don't seem to be working as I expected.
If I have the following in my property:
(let [greater (gen/large-integer* {:min 0 :max 10})
lesser (gen/bind greater (fn [x] (gen/large-integer* {:min 0 :max x})))]
(prop/for-all [less lesser
great greater]
(is (<= less great)))
when I run the test I always get the following failure:
expected: (<= less great)
actual: (not (<= 1 0))
@rabbitthirtyeight I know what's wrong, but don't know enough about what you're really doing to recommend an alternative
the reason it isn't doing what you think is that there's a different greater
being generated for each of less
and great