You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using spec-tools ("0.10.5") to spec a list of values, result spec produces inconsistent results when validated against in s/valid? and s/explain.
Clojure CLI version 1.11.1.1273
Minimal example:
(nscase
(:require [spec-tools.data-spec :as ds]
[clojure.spec.alpha :as s]))
(definvalid-data {:cards (list66)})
(defvalid-data {:cards [66]})
(defcards
{:cards [int?]})
(defndo-stuff [data]
(if (s/valid? (ds/spec::sp cards) data)
(println"Conforms to spec according to 'valid?'")
(println"Does not conform to spec according to 'valid?'"))
(if (s/explain-data (ds/spec::sp cards) data)
(println"Does not conform to spec according to 'explain-data'")
(println"Conforms to spec according to 'explain-data'")))
(comment
(do-stuff invalid-data)
(do-stuff valid-data))
For some reason s/valid? and s/explain produce different result when a list is used, but same when a vector is used. When I tried to reproduce this issue with spec created directly with clojure.spec.alpha, everything was fine, so it seems the problem is with spec-tools
The text was updated successfully, but these errors were encountered:
When using spec-tools ("0.10.5") to spec a list of values, result spec produces inconsistent results when validated against in s/valid? and s/explain.
Clojure CLI version 1.11.1.1273
Minimal example:
For some reason s/valid? and s/explain produce different result when a list is used, but same when a vector is used. When I tried to reproduce this issue with spec created directly with clojure.spec.alpha, everything was fine, so it seems the problem is with spec-tools
The text was updated successfully, but these errors were encountered: