gen.anything / gen.json: arbitrary Nix values #12
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Missing
gen.anything(an arbitrary Nix value: null, bool, int, float, string, list, attrset, recursively) andgen.json(the same withoutnull-free restrictions and with JSON-safe floats).Why
fast-check has
fc.anything/fc.json; Hypothesis builds the same withst.recursive. Properties over nixpkgslibfunctions (lib.isType,toJSONround trips,recursiveUpdate, ...) need "any value" and every example inexamples/nixpkgs-lib-*.nixcurrently assembles a subset by hand.Suggested shape
gen.recursive(#5) andgen.attrsOf(#4); doubles as the dogfood test for both.examples/nixpkgs-lib-comprehensive.nixshould be checked for hand-rolled equivalents to replace.Implemented in
d153fd0, pushed to main.