test.shrink
Jump to function (4) ›
test.shrink/args->rose#
(args->rose args)
Rose tree whose root is args and children shrink each positional
argument in place using its value-based shrinker. Arguments are
never dropped (they are function parameters, not collection
elements).
Example:
(args->rose [10])
test.shrink/shrink#
(shrink pred tree)
Walks rose tree tree depth-first, greedily descending into any
child whose root still fails pred. Returns
{:smallest v :shrink-steps n :tree final-tree}.
Example:
(shrink pred (value->rose failing-value))
test.shrink/shrink-args#
(shrink-args property args)
Shrinks a failing args vector using property. Returns
{:smallest args :shrink-steps n} where args is the smallest args
vector that still makes property fail.
Example:
(shrink-args property [10])
test.shrink/value->rose#
(value->rose v)
Builds a rose tree for v using the built-in shrink strategy that
matches its runtime type. Integers shrink toward zero; strings,
vectors, lists, hash-maps and sets shrink by element removal plus
recursive element shrinks; everything else is a leaf.
Example:
(value->rose 10)