test-check 2018-02-09

@gfredericks sorry the delay, I'm not sure I can use recursive-gen on this case

but I was able to make it work

this how it ended up:

(s/def ::query
  (s/coll-of ::query-expr :kind vector?
    :gen #(let [g (s/gen (s/coll-of ::query-expr :kind vector? :max-count 5))]
            (gen/->Generator
              (fn [rdn size]
                (if (> *query-gen-max-depth* 0)
                  (binding [*query-gen-max-depth* (dec *query-gen-max-depth*)]
                    (gen/call-gen g rdn size))
                  (gen/call-gen (gen/return []) rdn size)))))))

this limits the depth of the generator by using a dynamic var, was the best solution I could find

yeah, I think it's technically possible with recursive-gen but maybe not easy would definitely be better for spec to handle it without error