reiddraper / simple-check

QuickCheck for Clojure
http://reiddraper.github.io/simple-check/
286 stars 18 forks source link

Eagerly throw a helpful exception when elements is called on an empty collection #35

Closed gfredericks closed 10 years ago

gfredericks commented 10 years ago

Prior to this change elements will happily take an empty collection and call gen/choose with 0 and -1, which apparently generates lots of 0s and 1s, and then eventually throw an IndexOutOfBoundsException when it eventually calls nth on the empty collection.