A quick follow-up - if I use s/assert instead of s/valid you can see the
problem with the s/or tag (:b in this case) getting into the assertion val
(s/assert (s/and (s/or :a (s/and #(empty? (::data %))
#(empty? (::path %)))
:b #(= (::val %)
Hi all,
I'm writing a spec for a cursor-like type - a map with some ::data, a ::path
into the data, and a ::value - the value in the data at that path
I've written a spec that captures the constraint that (= (get-in data path)
value)
(s/valid? (s/and (s/keys :req [::val ::data ::path])