krestenkrab / triq

Trifork QuickCheck
http://krestenkrab.github.com/triq/
Apache License 2.0
281 stars 54 forks source link

changes int range generator to range across full given range #42

Closed Cloven closed 9 years ago

Cloven commented 9 years ago

changes the int(L,M) range generator to always range between L and M, regardless of samplesize.

essen commented 9 years ago

That makes it very similar to choose(Min, Max) doesn't it, except for the shrinker. :-)

Cloven commented 9 years ago

It does! There's some sort of unification possible there maybe, but I'm still trying to understand the code so I don't want to go for a big refactor yet.

Cloven commented 9 years ago

oh for fuck's sake github

essen commented 9 years ago

The proper docs for choose/2 say Equivalent to integer(Low, High). I wonder what the Quickcheck docs say? I really wish I could get my hands on those... EQCMini's doc has a choose/2 but no int/1,2; only an int/0, so can't really draw any conclusion from there.

essen commented 9 years ago

Though I guess proper only has int/0, then integer/0 and integer/2, the latter two acting like choose/2 (disregarding the sample size) while int/0 makes use of the sample size.

Cloven commented 9 years ago

proper is GPL and EQCMini has a no-reverse-engineering license from what I understand, so I think looking at the Haskell version is probably the safest bet to try to divine algorithmic intent. I'm going to try to find time to go through all the papers listed by the original authors here: http://www.cse.chalmers.se/~rjmh/QuickCheck/

On Sat, Dec 20, 2014 at 12:55 PM, Loïc Hoguin notifications@github.com wrote:

Though I guess proper only has int/0, then integer/0 and integer/2, the latter two acting like choose/2 (disregarding the sample size) while int/0 makes use of the sample size.

— Reply to this email directly or view it on GitHub https://github.com/krestenkrab/triq/pull/42#issuecomment-67749342.

essen commented 9 years ago

GPL doesn't apply to documentation, you can use documentation to rewrite something regardless of project license. Of course you have to assume the documentation is correct and up to date... :-)

zkessin commented 9 years ago

You can also look at Ried Draper's simple check (Clojure) for ideas, or just ask Ried to himself