Given a 5-tuple of
lists of 16-bit integers, we want to test the property that if each list sums
to less than 256, then the sum of all the values in the lists is less than
5 * 256. This is false because of overflow. e.g.
([-20000], [-20000], [], [], [])
is a counter-example.
The interesting thing about this example is the interdependence between separate parts of the sample data.
A single list in the tuple will never break the invariant, but you need at least two lists together.
This prevents most of trivial shrinking algorithms from getting close to a minimum example,
which would look somethink like ([-32768], [-1], [], [], [])
.
Library | Code | Report |
---|---|---|
Americium | Bound5Spec.scala | bound5.md |
jqwik | Bound5Properties.java | bound5.md |
FsCheck | Bound5.fsx | bound5.md |
fast-check | bound5.js | bound5.md |
CsCheck | ShrinkingChallengeTests.cs | bound5.md |
elm-test | Bound5.elm | bound5.md |