Skip to main content

for-all

macro

clojure.test.check.properties/for-all

(for-all [bindings & body])
Returns a property, which is the combination of some generators and an assertion that should be true for all generated values. Properties can be used with `quick-check` or `defspec`. `for-all` takes a `let`-style bindings vector, where the right-hand side of each binding is a generator. The body should be an expression of the generated values that will be tested for truthiness, unless it is a special implementation of the clojure.test.check.results/Result protocol. Exceptions in the body will be caught and treated as failures. When there are multiple binding pairs, the earlier pairs are not visible to the later pairs. If there are multiple body expressions, all but the last one are executed for side effects, as with `do`. Example: (for-all [a gen/large-integer b gen/large-integer] (>= (+ a b) a))

No examples yet. Be the first to add one!