Closed frenchy64 closed 1 year ago
Thanks! The generator-debug
is really nice. It would be useful as part of test.check itself? Or as a standalone library? It definitely can be part of malli, but I think people would find it useful in a larger context too.
Anyway, big thanks for resolving this.
@ikitommi agreed this seems more broadly useful. Since generators are records, perhaps a library can be made that even makes hybrid "inspectable" generators---that just assoc extra information to generators that looks like an AST.
:+
generators with recursive variables can become[:+ :UNREACHABLE]
, which corresponds to the impossible generator(gen/not-empty (gen/return ()))
. In this case, it should reduce to(-never-gen)
.Added a useful debugging namespace that generates AST's for generators, which is how I found the root problem. Because of the way it's generated, I had to qualify some keywords using an alias instead of auto-namespacing.
Original report: https://clojurians.slack.com/archives/CLDK6MFMK/p1670138741691259