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

0 votes
in Spec by

Function clojure.spec.test.alpha/check silently ignores symbols which are not "checkable". This seems counter-intuitive to me because I'd expect it to fail when I call check on a symbol and the symbol does not have a spec (e.g. it is misspelled).

The definition of check looks like this:

`
(defn check
([] (check (checkable-syms)))
([sym-or-syms] (check sym-or-syms nil))
([sym-or-syms opts]

(->> (collectionize sym-or-syms)
     (filter (checkable-syms opts))
     (pmap
      #(check-1 (sym->check-map %) opts)))))

`

It seems to me that the (filter (checkable-syms opts)) might better go to the no-arg variant.

3 Answers

0 votes
by

Comment made by: josip.gracin@gmail.com

Attaching clj-2472-1.patch. It preserves backward-compatibility which complicates it a bit.

0 votes
by

Comment made by: josip.gracin@gmail.com

Minor change to the patch (using 'when' instead of 'if'). The idea of the solution is to introduce a new option :assert-checkable which asserts that provided syms are checkable.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-2472 (reported by josip.gracin@gmail.com)
...