Repository navigation
prop 0.4.0
Needs Agentica 0.31.0.
Added
Prop.bytes(min, max)makesBytes, which shrink to fewer and smaller bytes. A counterexample of bytes is reported as the list of their values.Prop.non_empty_list(gen, max_size)makes lists of at least one item, which never shrink to the empty list. WithProp.int(1, 12)it is the sizes of the pieces that cut a sequence, so a law can try any cut.Prop.map_shown(gen, show, f)isProp.mapfor a result that JSON cannot encode, such as a struct with aBytesfield.- The docs say how to write
GenandPairbare:import {Gen, Pair} from "pkg/prop/prop".
Changed
- Breaking: a
Genhas ashowfield, the text of a value in a counterexample, so aGen(...)built by hand needsshow: ....Prop.checkandProp.exhaustiveno longer need the generated type to be JSON-encodable; the six laws,Prop.eq,Prop.mapandProp.one_ofstill do. The text of every other generator is whatJSON.encodegave.