Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 2 KB

deletion.md

File metadata and controls

26 lines (19 loc) · 2 KB

Deletion

Original source

This tests the property "if we remove an element from a list, the element is no longer in the list". The remove function we use however only actually removes the first instance of the element, so this fails whenever the list contains a duplicate and we try to remove one of those elements.

This example is interesting for a couple of reasons:

  1. It's a nice easy to explain example of property-based testing.
  2. Shrinking duplicates simultaneously is something that most property-based testing libraries can't do.

The expected smallest falsified sample is ([0, 0], 0).

Implementors

Library Code Report
Americium DeletionTest.java deletion.md
jqwik DeletionProperties.java deletion.md
fast-check deletion.js deletion.md
CsCheck ShrinkingChallengeTests.cs deletion.md
elm-test Deletion.elm deletion.md