def report

bend-kit-property@0.4.0.0 · property.bend:108

import bend-kit-property@0.4.0.0/property.bend as Property
import Base

108# Print the seed and draw index so a failing check can be replayed.
109def report(~T: Type, ~show: T -> String, result: Maybe<&1, Failure<T>>) -> IO(Bool):
110  match result:
111    case None{}:
112      IO.pure(Bool, True{})
113    case Some{Failure{seed, trial, value}}:
114      do IO<Bool>:
115        IO.print("property failed: seed=" ++ U32.show(seed) ++ " trial=" ++ Nat.show(trial) ++ " counterexample=" ++ show(value))
116        return False{}

Uses (12)

Used by (1)