Clojurians
#test-check
<
2017-02-09
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

gfredericks12:02:52

I think test.check should have builtin generators for uniform doubles and uniform integers

gfredericks12:02:24

since those can be useful tools for building other generators

gfredericks12:02:35

each is a bit tricky though

gfredericks12:02:59

A) for uniform doubles, should the value shrink? how exactly?

gfredericks12:02:53

B) for uniform integers, how should the clj and cljs versions relate? clj could provide arbitrary ranges of integers, while cljs is natively limited to ±2^53

gfredericks12:02:53

cljs could do something fancy where it allows goog integers as well as native integers and if you give it bounds outside of native integers it generates googs

gfredericks12:02:31

(or would it be more correct to generate types based on the types you pass in? so if you give it a couple small googs for the range it still generates googs)

gfredericks12:02:51

now that I've said "goog" so many times out loud I realize that a reasonable cljs approach is just to only support the native range

gfredericks12:02:10

and have the generator constructor throw if you try to do anything else

gfredericks13:02:03

okay I think I will do that. (gen/uniform-integer min-inclusive max-exclusive) and gen/uniform-double