The :map-of generator should use (gen/vector-distinct-by first ..) in order to satisfy :min, otherwise it can generate less than the minimum number of entries by generating the same key multiple times with different vals.
such-that and functions built on it accept a custom error message on generation failures. It's very helpful to have the precise schema that failed in the error message.
The unreachable elements case for :map-of disallows generating the empty map if :max was non-zero. It's perfectly fine to generate empty regardless of :max. Other collection generators almost made this mistake by checking (<= (or min 0) 0 (or max 0)), which is technically correct but simplifiable to (= 0 (or min 0)).
coll-distinct-gen nested generators incorrectly in the unreachable elements case. We want (-never-gen options), not (gen/fmap f (-never-gen options)) which defeats our simplification logic of checking for -never-gen's metadata.
The
:map-of
generator should use(gen/vector-distinct-by first ..)
in order to satisfy:min
, otherwise it can generate less than the minimum number of entries by generating the same key multiple times with different vals.such-that
and functions built on it accept a custom error message on generation failures. It's very helpful to have the precise schema that failed in the error message.The unreachable elements case for
:map-of
disallows generating the empty map if:max
was non-zero. It's perfectly fine to generate empty regardless of:max
. Other collection generators almost made this mistake by checking(<= (or min 0) 0 (or max 0))
, which is technically correct but simplifiable to(= 0 (or min 0))
.coll-distinct-gen
nested generators incorrectly in the unreachable elements case. We want(-never-gen options)
, not(gen/fmap f (-never-gen options))
which defeats our simplification logic of checking for-never-gen
's metadata.