test-check

rabbitthirtyeight 2017-06-26T19:44:04.429145Z

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))

2017-06-26T20:28:48.384238Z

@rabbitthirtyeight I know what's wrong, but don't know enough about what you're really doing to recommend an alternative

2017-06-26T20:29:02.389324Z

the reason it isn't doing what you think is that there's a different greater being generated for each of less and great