lumo

:lumo: Standalone ClojureScript environment. Currently at version 1.9.0
anmonteiro 2017-12-08T00:21:22.000015Z

test.check is not bundled with Lumo

anmonteiro 2017-12-08T00:21:34.000354Z

no plans to bundle it either

2017-12-08T10:13:49.000458Z

maybe there are plans to make spec not depend on test.check, as far as I see, cljs.spec.test/instrumentation should be highly encouraged to be used.

dominicm 2017-12-08T10:36:34.000241Z

I'm casting my mind quite far back here, but I seem to recall the dependency being optional.

dominicm 2017-12-08T10:36:46.000012Z

Unless you wanted to use feature X

2017-12-08T12:48:11.000187Z

cljs.spec.test.alpha/instrument needs clojure.test.check, strangely.

2017-12-08T12:48:35.000019Z

or the whole spec.test, like I wrote above.

richiardiandrea 2017-12-08T18:08:08.000299Z

Yes, that is a ClojureScript requirement....

johnjelinek 2017-12-08T22:00:20.000069Z

why no plans to bundle it?

mfikes 2017-12-08T22:14:21.000463Z

I've also resisted bundling it with Planck—it is not part of ClojureScript proper and it has its own independent release cycle.

mfikes 2017-12-08T22:14:56.000214Z

As a counter argument, where do you stop? Should Andare be bundled, etc.?

mfikes 2017-12-08T22:15:58.000028Z

One place that I've made an exception is for Replete, where you have no choice. (It also seems to fit with the app's name, having it bundle lots of libs 🙂 )

mfikes 2017-12-08T22:29:32.000367Z

@hlolli The reason you need test.check for instrument is perhaps best explained with a concrete example. But the general idea is that it needs to generate values to pass to speced higher order functions. Example:

cljs.user=> (require '[clojure.spec.alpha :as s])
nil
cljs.user=> (s/def ::foo (s/fspec :args (s/cat :x int? :y string?)))
:cljs.user/foo
cljs.user=> (defn some-foo [x y] (prn x y))
#'cljs.user/some-foo
cljs.user=> (defn bar [foo z] (prn z))
#'cljs.user/bar
cljs.user=> (s/fdef bar :args (s/cat :foo ::foo :z int?))
cljs.user/bar
cljs.user=> (require '[clojure.spec.test.alpha :as st])
nil
cljs.user=> (st/instrument)
[cljs.user/bar]
cljs.user=> (bar some-foo 3)
0 ""
-1 ""
0 "7"
1 "iet"
0 "P"
6 "T33"
3 "L"
-6 "fu775"
0 "2v9K655S"
-118 "7G3"
-2 "52q"
-51 "6f37zW351"
5 "934"
-4046 "087Fd"
0 "94Y3oMjl"
-1 "0e02j0kH3o45"
-323 "A8saPQ74W7kv5u6"
29 "T6fZD973dfJ"
189 "30ZBgZ27Xn"
5056 ""
-794 "bJf9MRNBtZBCxW5rN7p"
3
nil

2017-12-10T00:04:37.000044Z

Surprised and confused about how instrument works. I thought the goal was to alert the user that he provided arguments in runtime that defy the spec.

mfikes 2017-12-08T22:32:39.000493Z

If this surprises you, it did me as well, and Alex gave some insight https://clojurians-log.clojureverse.org/clojure-spec/2017-06-06.html