Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 2.23 KB

distinct.md

File metadata and controls

23 lines (16 loc) · 2.23 KB

Distinct Elements in a List

Original source

This tests the example provided for the property "a list of integers containing at least three distinct elements".

This is interesting because:

  1. Most property-based testing libraries will not successfully normalize (i.e. always return the same answer) this property, because it requires reordering examples to do so.
  2. Hypothesis and test.check both provide a built in generator for "a list of distinct elements", so the "example of size at least N" provides a sort of lower bound for how well they can shrink those built in generators.

The expected smallest falsified sample is [0, 1, -1] or [0, 1, 2].

Implementors

Library Code Report
Americium DistinctTest.java distinct.md
jqwik DistinctProperties.java distinct.md
PropEr distinct.erl distinct.md
fast-check distinct.js distinct.md
CsCheck ShrinkingChallengeTests.cs distinct.md
elm-test Distinct.elm distinct.md