[CLJ-2071] Unexpected behavior with clojure.spec/tuple and clojure.spec.test/instrument Created: 01/Dec/16 Updated: 01/Dec/16 Resolved: 01/Dec/16
|Affects Version/s:||Release 1.9|
Clojure 1.9, JDK 8
It looks like stest/instrument is comparing a sequence of actual args to a vector created by spec/tuple and it doesn't match, however clojure.spec.test/instrument appears to work fine. Reading the clojure.spec guide I would think the two approaches would be equivalent.
|Comment by Ben Rady [ 01/Dec/16 8:11 AM ]|
Note that the namespace in this example was changed. It used to be specific.core-spec, which is shown in the error.
|Comment by Alex Miller [ 01/Dec/16 10:22 AM ]|
Spec will create a list or a seq of the args for checking the :args spec. Tuples can only be used on vectors (because they match by index). So, this is not currently expected to work. It is recommended that you use a regex spec (s/cat) instead.