Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by
edited by

Hello,

while trying to port some Clojure code to Clojurescript, I encountered a problem in my test suite when trying to check a list of function specs symbols using cljs.spec.test.alpha/check.

Here is a small scenario to reproduce the issue:

`
(ns spec.check.problem
(:require
[clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as gen]
[clojure.spec.test.alpha :as stest]
[clojure.test.check]
[clojure.test.check.properties]))

(defn foo
[x]
(inc x))

(s/fdef foo
:args (s/cat :x int?)
:ret int?)

(def list-of-specs
`[foo])

(stest/check `[foo]) ; => OK

(stest/check list-of-specs) ; => Unable to resolve symbol: list-of-specs in this context
`

The above example work with Clojure but not with ClojureScript. Is that intended or is this a bug ?

I have used Clojure 1.10.1 and Clojurescript 1.10.758 for my tests.

1 Answer

+1 vote
by

In CLJS check is a macro and therefore a lot less flexible unfortunately.

Not a bug.

...