This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-14
Channels
- # adventofcode (1)
- # babashka (60)
- # beginners (107)
- # calva (11)
- # cider (3)
- # clara (11)
- # clj-kondo (6)
- # cljs-dev (33)
- # clojure (70)
- # clojure-dev (4)
- # clojure-europe (3)
- # clojure-italy (2)
- # clojure-kc (1)
- # clojure-losangeles (12)
- # clojure-nl (4)
- # clojure-spec (32)
- # clojure-uk (35)
- # clojuredesign-podcast (1)
- # clojurescript (28)
- # core-logic (4)
- # cursive (5)
- # datomic (34)
- # devcards (1)
- # emacs (16)
- # events (13)
- # fulcro (15)
- # graalvm (5)
- # graphql (3)
- # jobs (8)
- # joker (2)
- # kaocha (17)
- # malli (6)
- # music (3)
- # off-topic (58)
- # protorepl (7)
- # re-frame (28)
- # rewrite-clj (9)
- # shadow-cljs (102)
- # spacemacs (3)
- # sql (20)
- # tools-deps (9)
Is there a ticket for spec to bring in the rest of the generators in clojure.test.check.generators
?
we did not have a general goal to replicate all aspects of test.check.generators in spec.gen
so, no as we do not intend to do so
you can just use them from test.check if you need them?
is there something specific you're looking for?
I mean which generator functions?
The ones that we have copied over are: generator?, let, vector-distinct-by. I believe there may be some others scattered throughout the code though.
is the dynaload stuff in gen exposed enough to just use?
lazy-combinator is public though, right?
ah, so you can't get to the expansion, right
let's a macro - so I presume that's not something you can dynaload?
there actually is a ticket about that one in particular
vector-distinct-by could be done through (s/gen (s/coll-of ::foo :distinct true :into [])) ?
oh, distinct-by
generator? is prob weird given the thunking done in gen isn't it?
so these each seem like distinct issues
there's a ticket for let already, generator? could just be made public, and vector-distinct-by could be added to the dynaload list
Yep. @U051KLSJF may be interested in some other missing ones. I'm pretty sure there's a few others I've run into.
I've made the generator? and vector-distinct-by changes in spec-alpha2
I was missing byte
which prompted me to ask, there are also more generators around ints which aren’t exposed
I find that the things in clojure.spec.gen.alpha
are sufficient to define generators for specs, and I only need the things in clojure.test.check.generators
for generating "interesting" data for tests.
you can get pretty far by using (s/gen <some-spec>) too
often I find that's easier that constructing the generator from scratch