jqwik-team / jqwik

Property-Based Testing on the JUnit Platform
http://jqwik.net
Eclipse Public License 2.0
576 stars 64 forks source link

Support UniqueElements annotation for Extensions #466

Closed jlink closed 1 year ago

jlink commented 1 year ago

Testing Problem

Extensions (eg jqwik-vavr have to add their own configurator if they want to support @UniqueElements for custom-made arbitraries. Allow extensions to use the existing UniqueElementsConfigurator.

Suggested Solution

This could be done by introducing an interface for Arbitrary.uniqueElements(..) eg Uniquable.

Discussion

Alternative implementation: Add the method to StreamableArbitrary. But currently, not all subtypes support unique elements.

jlink commented 1 year ago

Implemented in https://github.com/jqwik-team/jqwik/commit/15f606701a4f9a4fc4f01d67306aaaa45a656a51