Simeon Leyzerzon
Simeon Leyzerzon

Reputation: 19074

Vavr property testing

Property checking feature is advertised in the latest Vavr documentation along with the following example of its usage:

Arbitrary<Integer> ints = Arbitrary.integer();

// square(int) >= 0: OK, passed 1000 tests.
Property.def("square(int) >= 0")
        .forAll(ints)
        .suchThat(i -> i * i >= 0)
        .check()
        .assertIsSatisfied();

However, as per the library's javadoc, neither Arbitrary generator nor Property type exist.

What am I missing, if any? Is the documentation up to date?

Upvotes: 2

Views: 326

Answers (1)

Simeon Leyzerzon
Simeon Leyzerzon

Reputation: 19074

Turns out, the following vavr-test dependency was missing, which is not obvious from Vavr documentation:

<dependency>
    <groupId>io.vavr</groupId>
    <artifactId>vavr-test</artifactId>
    <version>0.9.1</version>
</dependency>

Upvotes: 4

Related Questions