-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
s/and fails in some cases #165
Comments
That's not good. It seems that the form-walker just tries to walk over Should be easy to fix thou. |
Checked all the wrapped specs, by adding the original spec reference to parse results, all of these work: (s/def ::pos? (st/spec {:spec (partial pos?), :decode/string transform/string->long}))
(testing "referenced specs, #165"
(is (= 1 (st/coerce (s/and ::pos?) "1" st/string-transformer)))
(is (= 1 (st/coerce (s/or :default ::pos?) "1" st/string-transformer)))
(is (= [1 2 3 :4] (st/coerce (s/coll-of ::pos?) ["1" "2" "3" :4] st/string-transformer)))
(is (= {1 :2, :3 4} (st/coerce (s/map-of ::pos? ::pos?) {"1" :2, :3 "4"} st/string-transformer)))
(is (= [1 :2 3 "4"] (st/coerce (s/tuple ::pos? keyword? ::pos?) ["1" "2" "3" "4"] st/string-transformer)))
(is (= 1 (st/coerce (s/nilable ::pos?) "1" st/string-transformer)))) looks ok? |
@ikitommi looks really good! |
* new parsed types :tuple and :nilable
* new parsed types :tuple and :nilable
FIxed in |
Using
s/and
with a single spec, the behaviour should be the same as without s/and (at least thats the principle of least surprise).The text was updated successfully, but these errors were encountered: