Skip to content

Property2

class in io.proptastic

class Property2<A, B>

A property over 2 draws, from forAll. Pin examples, then .check: examples run first, don’t count toward the tries and never shrink.

Methods

example

Property2<A, B> example(A a, B b)

One example, run before the random tries, its values in the draws’ order.

check

void check(Property2.Check<A, B> check)

Runs the property now: throws with the shrunk counterexample if check fails.

follows

void follows(Model model, Property2.Answer<A, B> answer)

Runs the property against model: for each try, the code’s answer must be the one the model allows, and every outcome the model names must come up, or be .unreachable. A pass prints what was followed.

Privacy