This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-03-01
Channels
- # announcements (4)
- # aws (1)
- # beginners (172)
- # cider (16)
- # cljdoc (63)
- # cljsrn (7)
- # clojure (150)
- # clojure-dev (8)
- # clojure-europe (26)
- # clojure-gamedev (6)
- # clojure-greece (23)
- # clojure-nl (4)
- # clojure-spec (10)
- # clojure-uk (101)
- # clojurescript (40)
- # community-development (5)
- # cursive (19)
- # datomic (54)
- # emacs (39)
- # figwheel-main (5)
- # fulcro (4)
- # graphql (16)
- # immutant (5)
- # jobs (8)
- # jobs-rus (1)
- # leiningen (1)
- # off-topic (31)
- # planck (1)
- # re-frame (7)
- # reagent (8)
- # reitit (6)
- # remote-jobs (4)
- # shadow-cljs (11)
- # spacemacs (18)
- # specter (2)
- # sql (58)
- # vim (2)
- # yada (5)
is there a way to provide a generator to a spec you want to use at runtime for validation, but have test.check only as a dev/test dependency?
@djtango the whole point of spec's proxy namespace for generators is to allow that
you reference/build the generator using that namespace, and as long as you don't use it, t.c isn't needed
I think any function calls in that ns have to be delayed inside a (fn [] ...)
so that they don't actually happen
which is part of why the spec api requires you to supply a 0-arg-function-that-returns-a-generator
I’m using this feature a lot, but it took a trick to get the string-from-regex generator to be decoupled from production code… https://github.com/borkdude/speculative/blob/master/src/speculative/specs.cljc#L180