Closed nilern closed 3 months ago
While I was trying to describe Malli forms with Malli I noticed that recursive generator generation can diverge:
(mg/generator [:schema {:registry {::schema [:or [:= :int] [:= :string] [:cat [:= :and] [:* [:schema [:ref ::schema]]]] [:cat [:= :or] [:* [:schema [:ref ::schema]]]] [:tuple [:= :vector] [:ref ::schema]]]}} ::schema]) ; Execution error (OutOfMemoryError) at malli.generator/-create (generator.cljc:219). ; GC overhead limit exceeded
Perhaps malli.generator should use clojure.test.check.generators/recursive-gen instead of the current ad hoc recursion depth limiting? I don't really get the current limits, so can't really say whether they can be made to work for all schemas.
malli.generator
clojure.test.check.generators/recursive-gen
There is such a thing? Please.
Generation now uses recursive-gen via https://github.com/metosin/malli/issues/452
recursive-gen
yes, this works now.
While I was trying to describe Malli forms with Malli I noticed that recursive generator generation can diverge:
Perhaps
malli.generator
should useclojure.test.check.generators/recursive-gen
instead of the current ad hoc recursion depth limiting? I don't really get the current limits, so can't really say whether they can be made to work for all schemas.