Repository navigation
v2.4.0
In-body dependent draw (T2.5). Additive, no BC breaks; existing seed sequences
are unchanged (a property that never calls Gen::draw() generates exactly the
same values as before).
-
Fix: aggregate property results now carry the per-run
TestResult
attributes (merged run-by-run, last write per key wins) on all paths —
passed, falsified, coverage violation and failing explicit example.
Previously the interceptor returned a bareTestResult, dropping
attributes attached by downstream interceptors — notably Testo codecov's
CoverageResult, so property tests were missing from per-test coverage
(<covered by>), and mutation-testing tools like Infection never selected
them when running mutants: mutants on lines covered only by property tests
escaped silently. -
Add
Gen::draw($arbitrary)— generate a value inside the property body when
several dependent values make nestedflatMapawkward. The domain may depend
on parameters, previous draws, or intermediate results. -
Drawn values shrink together with the parameters via a replay tape: every
draw is recorded as aShrinkable, shrunk through its own tree, and the body
is re-run with the tape replayed by position. Draws past the tape's end
(control flow changed under a smaller prefix) are generated anew; draws the
smaller run no longer reaches are dropped. -
Counterexamples report draws as
draw#1,draw#2, ... next to the named
parameters;PROPERTY_VERBOSEadditionally logs each run's draws. -
With draws present, accepted shrink steps are capped at 1000 (an explicit
maxShrinksstill wins) — a regrown tape carries fresh trees, so the
finite-tree termination argument alone no longer applies. -
Gen::draw()outside a property run throws aRuntimeException. Explicit
examples may draw too (their draws come from a dedicated deterministic
stream).