Skip to content

v2.6.0

Choose a tag to compare

@rasuvaeff rasuvaeff released this 01 Aug 22:16
· 38 commits to master since this release
53c9c49
  • Psalm generics across the public surface: ArbitraryInterface<TValue>,
    Shrinkable<TValue>, all built-in arbitraries, and the Gen facade typed
    end-to-end — consumer code gets inference (Gen::map(Gen::intBetween(0, 5), fn(int $n): string => ...) is ArbitraryInterface<string>) and closure
    parameters check against the inner arbitrary's type. Docblock-only; runtime
    behaviour is unchanged.
  • Counterexample messages gain a Changed: line diffing the original against
    the shrunk arguments (unchanged arguments omitted) and a trial count next to
    the accepted shrink steps: (12 shrink step(s), 41 trial(s)).
  • CounterExample exposes shrinkTrials — the total number of shrink
    candidates tried (accepted and rejected); included in toArray()/toJson().
  • PROPERTY_VERBOSE now also traces the shrink descent: one line per accepted
    candidate (shrink step 3: x=63 -> 51), including draw#N tape positions.
  • #[Property(timeoutMs:)] — opt-in wall-clock deadline for a single run
    (random or example). A body that takes longer fails the property with a new
    DeadlineExceededException naming the offending input — protection against
    pathological inputs (catastrophic regex, deep recursion, unbounded backoff).
    Measured post-run; the input is reported unshrunk.
  • #[Property(budgetMs:)] — opt-in wall-clock budget for the whole random
    phase. Running out before the requested checks complete fails the property
    with a new TimeBudgetExceededException exposing completed/required run
    counts.