package qcheck-core
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=53cde85bd3f0431faeddeae493f32d9d
sha512=552871a95bcf27a81cd518a4aefc60ac0f08ef73c8e115f199952707b88ab20f7ecb762abb835a196c1adb7b948447e487daa0efbf6a39ee64bfcee0264f189f
doc/qcheck-core/QCheck/Shrink/index.html
Module QCheck.ShrinkSource
The Shrink module contains combinators to build up composite shrinkers for user-defined types
⚠️ Warning: QCheck's shrinking phase may loop infinitely if
- the shrinker returns its own argument as a shrinking candidate, or
- fails to return a strictly smaller shrinking candidate by some termination measure (e.g., a
listpermutation may lead to an infinite shrinking cycle).
Given a counter-example, return an iterator on smaller versions of the counter-example.
Printable char shrinker. Shrinks towards 'a' like !char. The output is also a printable character.
float shrinker. Shrinks floating point numbers towards 1.0 or -1.0 and prefers a shorter printed rendering.
float shrinker for bounded floating point numbers. float_bound b shrinks floating point numbers towards 0. for both positive and negative bounds b, preferring a shorter printed rendering.
float_range low high shrinks floating point numbers in the range low; high (inclusive). Shrinks towards low if low >= 0., towards high if high <= 0., and towards 0. if low < 0. and 0. <. high. It prefers a shorter printed rendering.
option shrinker. Shrinks towards None. option shk reduces Some v values using shk to reduce v.
result shrinker. result ashk eshk reduces Ok a values using ashk and Error e values using eshk.
filter f shrink shrinks values the same as shrink, but only keep smaller values that satisfy f. This way it's easy to preserve invariants that are enforced by generators, when shrinking values
Shrink integers by trying all smaller integers (can take a lot of time!)
Shrinks the elements of a list, without changing the list size.
pair a b uses a to shrink the first element of tuples, then tries to shrink the second element using b. It is often better, when generating tuples, to put the "simplest" element first (atomic type rather than list, etc.) because it will be shrunk earlier. In particular, putting functions last might help.
tup2 a b uses a to shrink the first element of tuples, then tries to shrink the second element using b. It is often better, when generating tuples, to put the "simplest" element first (atomic type rather than list, etc.) because it will be shrunk earlier. In particular, putting functions last might help.
Similar to tup2
val tup7 :
'a t ->
'b t ->
'c t ->
'd t ->
'e t ->
'f t ->
'g t ->
('a * 'b * 'c * 'd * 'e * 'f * 'g) tSimilar to tup2