parroty / excheck

Property-based testing library for Elixir (QuickCheck style).
MIT License
316 stars 26 forks source link

number generator? #2

Closed ornamentist closed 10 years ago

ornamentist commented 10 years ago

Thanks for developing ExCheck, looks very useful!

I might be missing something but could we have a number/1 generator function that generates either a random float or integer?

Currently I'm using oneof([real, int]) and wondering whether this belongs in ExCheck or in a helper function?

Stu

parroty commented 10 years ago

Thanks for the comment. I've defined as one generator. Initially I felt "oneof([real, int])" may suffice, but it may be one similar way of (subset form of) any/0, which is defined using oneof[int(), real(), bool(), atom() ...].